2013-04-13 3 views
0

получение ниже исключение при доступе к http://localhost:8081/ReportGeneratorJSF/ com.sun.faces.context.FacesFileNotFoundException: /login.xhtml Не найдено ExternalContext как ресурсJSF 2.0 FileNotFoundException

Я использую JSF 2.0

я есть создали login.xhtml внутри папки WEB-INF, который использует шаблоны 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> 

Можете ли вы предоставить решение для него.

ответ

1

У вас есть проблемы в ваших файлов, вам необходимо разместить их так:

WEB-INF 
- faces-config.xml 
- web.xml 
login.xhtml 
header.xhtml 
footer.xhtml 
... 
+0

Спасибо за помощь, она работала. я сделал глупую ошибку :( – Soheb

+0

@Soheb Рад, что это помогло, вы можете отметить как ответ! :) –