HTTP 状态 404 - (projectName)/faces/Login.xhtml - 请求的资源不可用
HTTP Status 404 - (projectName)/faces/Login.xhtml - the requested resource not available
我正在开发一些软件,但我遇到了这个问题
HTTP Status 404 - (projectName)/faces/Login.xhtml - the requested resource not available
在我办公室的笔记本电脑上它工作正常,但在我家里的笔记本电脑上我不知道这背后的问题是什么。
我尝试一次又一次地清除、重建项目,但问题没有解决。
我的其他项目运行很好。
这是我的 web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>EMSLoginAndAttendanceModule</display-name>
<welcome-file-list>
<welcome-file>Login.xhtml</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<context-param>
<description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<session-config>
<session-timeout>45</session-timeout>
</session-config>
</web-app>
这是我的 Login.xhtml
文件的结构
WebContent
|_META-INF
|_WEB-INF
|_faces-config.xml
|_web.xml
|_Login.xhtml
错误是因为 Deployment Assembly
中没有包含 libraries
,所以添加后错误已解决。
解决错误的步骤:
project
的 properties
比 Deployment Assembly
单击右窗格中的 Add
比 select Java Build path Entries
从那里我添加了我所有的 libs
并且错误消失了。
我正在开发一些软件,但我遇到了这个问题
HTTP Status 404 - (projectName)/faces/Login.xhtml - the requested resource not available
在我办公室的笔记本电脑上它工作正常,但在我家里的笔记本电脑上我不知道这背后的问题是什么。
我尝试一次又一次地清除、重建项目,但问题没有解决。
我的其他项目运行很好。
这是我的 web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>EMSLoginAndAttendanceModule</display-name>
<welcome-file-list>
<welcome-file>Login.xhtml</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<context-param>
<description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<session-config>
<session-timeout>45</session-timeout>
</session-config>
</web-app>
这是我的 Login.xhtml
文件的结构
WebContent
|_META-INF
|_WEB-INF
|_faces-config.xml
|_web.xml
|_Login.xhtml
错误是因为 Deployment Assembly
中没有包含 libraries
,所以添加后错误已解决。
解决错误的步骤:
project
的 properties
比 Deployment Assembly
单击右窗格中的 Add
比 select Java Build path Entries
从那里我添加了我所有的 libs
并且错误消失了。