2013-07-30 27 views
9

Tôi gặp lỗi này khi khởi chạy ứng dụng./faces/index.xhtml Không tìm thấy trong ExternalContext dưới dạng Tài nguyên trong Glassfish

com.sun.faces.context.FacesFileNotFoundException: /faces/index.xhtml Not Found trong ExternalContext như một tài nguyên

Đây là bối cảnh web.xml:

<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> 
    <context-param> 
     <param-name>javax.faces.PROJECT_STAGE</param-name> 
     <param-value>Production</param-value> 
    </context-param> 
    <context-param> 
     <param-name>primefaces.THEME</param-name> 
     <param-value>#{themeSwitcherBean.theme}</param-value> 
    </context-param> 
    <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> 
    <session-config> 
     <session-timeout>30</session-timeout> 
    </session-config> 
    <welcome-file-list> 
     <welcome-file>faces/index.xhtml</welcome-file> 
    </welcome-file-list> 
</web-app> 

Trả lời

2

Không thể tìm thấy index.xhtml mà bạn đã khai báo trong tệp web.xml của mình dưới dạng tệp Chào mừng/Chỉ mục

<welcome-file-list> 
     <welcome-file>faces/index.xhtml</welcome-file> 
    </welcome-file-list> 
+0

Không hoạt động trong JSF2.2 – cheloncio

Các vấn đề liên quan