jsf - Glassfish5:不调用 JSF FacesServlet
问题描述
Glassfish5:不调用 JSF FacesServlet。
例子.ear
example_ejb.jar
example_web.war
META-INF/application.xml
META-INF/application.xml
<application xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_8.xsd"
version="8">
<module>
<ejb>example_ejb.jar</ejb>
</module>
<module>
<web>
<web-uri>example_web.war</web-uri>
<context-root>example_web</context-root>
</web>
</module>
<library-directory>lib</library-directory>
</application>
example_web.war
WEB-INF/web.xml
home.xhtml
WEB-INF/web.xml
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<servlet>
<display-name>Faces Servlet</display-name>
<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>*.xhtml</url-pattern>
</servlet-mapping>
</web-app>
将 example.ear 部署到 Glassfish5,成功。但
http://localhost:8080/example_web/home.xhtml
HTTP 状态 404 - 未找到
在 FacesServlet.java 中设置断点,在调试模式下不调用 service() 方法。
解决方案
推荐阅读
- c - Vulkan Ray Tracing - 并非来自任何命中着色器的每个原始 Id
- angular - express app.delete 未被调用且未显示在控制台代码中
- android - Google 通常会向他们正在审核的应用发送垃圾邮件吗?
- php - sudo pecl install sqlsrv 错误:在 Catalina php7.4 上无法 mkdir /usr/local/Cellar/php/7.4.1/pecl/20190902
- javascript - 循环遍历链接内的所有图像,从图像路径中提取图像名称并使用 jQuery 将其转换为字符串
- java - 如何测试非阻塞通道的 SocketChannel.read() 是否已完成?
- javascript - 如何滚动 100% 的视口?(在每个设备上响应)
- c# - 如何在 WinForms 的 MenuStrip 中使用单键快捷方式?
- gradle - Gradle:如何获取存储在 .gradle 中的特定外部依赖项的路径?
- c++ - Catch2 C++ 链接器问题——包括类的未定义符号