gpt4 book ai didi

java -/faces/index.xhtml 在 ExternalContext 中找不到 Glassfish 中的资源

转载 作者:塔克拉玛干 更新时间:2023-11-03 03:25:07 24 4
gpt4 key购买 nike

我在启动应用程序时遇到此错误。

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

这是 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 文件

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

关于java -/faces/index.xhtml 在 ExternalContext 中找不到 Glassfish 中的资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17948066/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com