我有一个 JSF webapp,它表现出以下行为:
http://localhost/myapp/
返回 index.xhtml 的原始内容
http://localhost/myapp/web/
返回空白页
http://localhost/myapp/web/index.xhtml
返回错误/index.xhtml Not Found in ExternalContext as a Resource
webapp的目录结构如下图:
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_3_0.xsd" version="3.0">
<display-name>myapp</display-name>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</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>/web/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<!-- <welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
-->
</web-app>
我在方法的第一行有一个断点javax.faces.webapp.FacesServlet.service
public void service(ServletRequest req,
ServletResponse resp)
throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) resp;
requestStart(request.getRequestURI()); // V3 Probe hook
这个断点永远不会被命中。有没有人能够阐明这里可能出了什么问题,或者我可以从哪里开始调查的一些指示。