Tim Dean wrote:

Hello,

I am trying to configure a welcome file list in my Tomcat-deployed web app so that a Java Server Faces (JSF) view is used as the welcome file. My web.xml file contains the following:

    <welcome-file-list>
        <welcome-file>main.faces</welcome-file>
    </welcome-file-list>

As well as the following JSF servlet configurations:

    <servlet>
        <servlet-name>FacesServlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>FacesServlet</servlet-name>
        <url-pattern>*.faces</url-pattern>
    </servlet-mapping>

I have been unable to get this working no matter what I have tried. Whenever I request a directory within the web application's context, Tomcat shows a directory listing instead of the JSF view I've identified in the welcome file list.


Well, the problem is in the fact that a "list of welcome files" is just that, a list of FILES. So, when a URL is requested which is a directory, a list of "welcome" files will be looked up in that dir, in the given order.

What you gave was an incomplete Servlet URL mapping and that simply will not do for a welcome file list.

Perhaps you could try to setup a different mapping, like

<servlet-mapping>
       <servlet-name>FacesServlet</servlet-name>
       <url-pattern>*/</url-pattern>
   </servlet-mapping>

This might clash with directory URL mapping, which should be more internal to TC. Or is it handled by the Default Servlet? In that case, it would be OK, since this mapping is less general than "*".

Also, note that FacesServlet might not handle this properly, expecting the URL to point to some file/path/identifier (I know how Struts would see it...) and this might require additional setup in JSF config file (mapping that URL to appropriate component).

Nix.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to