/faces/index.xhtml在GlassFish中作为资源在ExternalContext中找不到 [英] /faces/index.xhtml Not Found in ExternalContext as a Resource in Glassfish

查看:192
本文介绍了/faces/index.xhtml在GlassFish中作为资源在ExternalContext中找不到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



I am getting this error while launching application.


com.sun.faces.context.FacesFileNotFoundException:/faces/index.xhtml
在ExternalContext中找不到作为资源

com.sun.faces.context.FacesFileNotFoundException: /faces/index.xhtml Not Found in ExternalContext as a Resource

这是web.xml的上下文:

This is the context of 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>


推荐答案

index.xhtml无法找到,您声明在你的web.xml中作为Welcome / Index文件

The index.xhtml cant be found, which you declared in your web.xml as Welcome/Index file

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

这篇关于/faces/index.xhtml在GlassFish中作为资源在ExternalContext中找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆