Why doesn't FacesServlet find .xhtml Facelet?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 07:50:37

问题


I've created an JSF Project from my Eclipse with JBoss Tools. Now I have the structure:

MyProjectFolder
 ⌊ WebContent
   ⌊ WEB-INF
   |  ⌊ lib
   |  ⌊ faces-config.xml
   |  ⌊ web.xml
   ⌊ META-INF
   ⌊ index.xhtml

My web.xml maps the following extensions to the FacesServlet: /faces/*, *.jsf, *.faces

When I now try to access /faces/index.xhtml, index.jsf and index.faces I get a 404 not found error. Only when I access index.xhtml directly I get a page but without jsf-content (what is clear for me).

So my question is now how the FacesServlet resolves the Faclet-Filename and path from my URL-Params? And how can I ensure, that it is not possible to access the index.xhtml directly?

PS I know the solution to add a servlet-mapping for *.xhtml but I think there should be an alternative.

Regards!

来源:https://stackoverflow.com/questions/13284275/why-doesnt-facesservlet-find-xhtml-facelet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!