<分区>
我想为我的 facelets 使用自定义 URL 扩展。例如,.asdf
而不是 .xhtml
或 .jsf
。
我将映射添加到我的 web.xml
:
<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>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.asdf</url-pattern>
</servlet-mapping>
index.asdf
位于 WebContent/facelets/common/index.asdf
但如果我尝试使用浏览器访问它 (http://localhost:8080/Project/facelets/common/index.asdf
) 我收到以下错误消息:
HTTP Status 404 - /Project/facelets/common/index.jsp
type Status report
message /Project/facelets/common/index.jsp
description The requested resource is not available.
Apache Tomcat/7.0.39
请注意,即使我没有在任何地方使用过 .jsp
扩展名,它也会显示 .jsp。有什么问题吗?