JSF 2.0 FileNotFoundException
访问JSF 2.0 FileNotFoundException,jsf,Jsf,访问http://localhost:8081/ReportGeneratorJSF/ com.sun.faces.context.FacesFileNotFoundException:/login.xhtml未作为资源在ExternalContext中找到 我正在使用JSF2.0 我在WEB-INF文件夹中创建了一个login.xhtml,它使用的是header.xhtml和footer.xhtml模板,使用的是basictemplate.xhtml //login.xhtml <ui:
http://localhost:8081/ReportGeneratorJSF/
com.sun.faces.context.FacesFileNotFoundException:/login.xhtml未作为资源在ExternalContext中找到
我正在使用JSF2.0
我在WEB-INF文件夹中创建了一个login.xhtml,它使用的是header.xhtml和footer.xhtml模板,使用的是basictemplate.xhtml
//login.xhtml
<ui:composition template="/WEB-INF/template/basictemplate.xhtml">
...
textboxs and submit button
...
</ui:composition>
...
文本框和提交按钮
...
//web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>ReportGeneratorJSF</display-name>
<welcome-file-list>
<welcome-file>faces/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>
</web-app>
ReportGeneratorJSF
faces/login.xhtml
Facesservlet
javax.faces.webapp.FacesServlet
1.
Facesservlet
/面孔/*
您能提供解决方案吗。您的文件中有问题,您需要这样放置它们:
WEB-INF
- faces-config.xml
- web.xml
login.xhtml
header.xhtml
footer.xhtml
...