-
1. Re: welcome file doesn't work
sfcoy Mar 3, 2012 2:54 AM (in response to japochino1)What does the servlet mapping in your web.xm look like?
If it looks like this:
{code:xml}
<servlet-mapping>
<servlet-name>your-faces-servlet-name</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
{code}
then your welcome file entry should look like:
{code:xml}<welcome-file>inicio.faces</welcome-file>{code}
-
2. Re: welcome file doesn't work
japochino1 Mar 4, 2012 3:16 AM (in response to sfcoy)My web.xml:
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>inicio.jsf</welcome-file>
</welcome-file-list>
But it's not working
-
3. Re: welcome file doesn't work
sfcoy Mar 4, 2012 4:14 AM (in response to japochino1)Presumably you either have a inicio.jsp or inicio.xhtml file?
If that is the case then add an empty dummy file called inicio.jsf in the root of your application.
The spec says that welcome file resources must physically exist (even though it may never actually use the physical file for rendering).
-
4. Re: welcome file doesn't work
japochino1 Mar 4, 2012 4:42 AM (in response to sfcoy)I didn't have a inicio.jsf physically.
I have created it and now it's working.
Thank you!
-
5. Re: welcome file doesn't work
sfcoy Mar 4, 2012 4:48 AM (in response to japochino1)It's a not very well known "trick".
You will see countless examples that have a dummy html file that just contains a redirect header like:
{code:xml}<meta http-equiv="Refresh" content= "0; URL=inicio.jsf"/>{code}
I like my way better!