0

I have a web jsf project, with, inside my Web Pages directory:

/WEB-INF  
/faces  
/res  
index.jsp  

My faces dir got the files all.xhtml and login.xhtml.

My web.xml

<servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*.xhtml</url-pattern>
</servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>/faces/login.jsp</welcome-file>
    </welcome-file-list>

But when I run my project, JSF can't find any of my xhtml files. I don't understand why.

L.Butz
  • 2,466
  • 25
  • 44
Simon
  • 619
  • 2
  • 9
  • 23

1 Answers1

2

According to this post, you have to define the mapping like this:

 <servlet-mapping>
     <servlet-name>Faces Servlet</servlet-name>
     <url-pattern>/faces/*</url-pattern>
 </servlet-mapping>

or like that:

  <servlet-mapping>
     <servlet-name>Faces Servlet</servlet-name>
     <url-pattern>*.xhtml</url-pattern>
  </servlet-mapping>

see also:

Community
  • 1
  • 1
L.Butz
  • 2,466
  • 25
  • 44