Search code examples
javajsf-2prettyfaces

Welcome page in JSF using pretty


I'm using JSF 2.0.5, Tomcat 7.0.12 and prettyfaces.

My web.xml file is:

<welcome-file-list>
    <welcome-file>/index.jsp</welcome-file>
</welcome-file-list> 

My pretty file configuration:

<url-mapping>
    <pattern>/</pattern>
    <view-id>/jsp/index.jsf</view-id>
</url-mapping> 

My index.jsp file is empty.

My question is, when i hit to http://www.foo.com/ he is eventually redirecting to http://www.foo.com/jsp/index.jsf and because of the pretty we redirecting to http://www.foo.com/ again.
Can someone explain why he is hitting jsp/index.jsf?


Solution

  • I think I found the answer.

    Because I'm using pretty:

    <url-mapping>
        <pattern>/</pattern>
        <view-id>/jsp/index.jsf</view-id>
    </url-mapping> 
    

    So when I'm hitting http://www.foo.com/ the pretty translated the '/' to http://www.foo.com/jsp/index.jsf