Details
Description
While investigating the 4.1 TCK tests, a 404 was returned for some pages in the headAndBodyRenderer app. Only the `*.xhtml` extensions worked even though the servlet mappings were listed:
web.xml:
<servlet> <servlet-name>facesServlet</servlet-name> <servlet-class&gt;jakarta.faces.webapp.FacesServlet</servlet-class&gt; </servlet> <servlet-mapping> <servlet-name>facesServlet</servlet-name> <url-pattern>*.xhtml</url-pattern> <url-pattern>*.xhtmlAsXhtml</url-pattern> <url-pattern>*.xhtmlAsXml</url-pattern> </servlet-mapping>
Turns out that our FaceletViewDeclarationLanguageStrategy class looked if *.xhtml matched, and if not, then it looked at any mappings set via jakarta.faces.FACELETS_VIEW_MAPPINGS. This isn't set in the app. Ultimately, FaceletViewDeclarationLanguageStrategy#handlesView returns false and since no VDL is found, the page fails to load.
I think we should update the code to look at the servlet mappings, too.