1

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!

Matt Handy
  • 29,855
  • 2
  • 89
  • 112
Gerrit
  • 2,515
  • 5
  • 38
  • 63
  • /faces/index.xhtml should actually work. What did you use as "welcome-file" in web.xml ? – vasquez Nov 08 '12 at 07:38
  • No welcome file defined. – Gerrit Nov 08 '12 at 07:51
  • Sorry, but I get for /faces/index.xhtml the 404 again. – Gerrit Nov 08 '12 at 07:53
  • 1
    *"I know the solution to add a servlet-mapping for *.xhtml"*. Please confirm if it also *really* have solved the concrete problem. I don't think so, but you're implying otherwise which is pretty strange. If it did, then please post more detail about your minimum necessary project configuration in order to reproduce the problem. Tell which MyFaces version exactly you're using, tell how you configured the JARs, show the entire web.xml, etc. – BalusC Nov 08 '12 at 12:16
  • Why do you have multiple URL patterns for your FacesServlet? Do you actually plan to use all those patterns? See http://stackoverflow.com/q/13145248/1530938 – kolossus Nov 08 '12 at 16:34

0 Answers0