On 4/12/06, Murray Brandon <[EMAIL PROTECTED]> wrote:
> I've attached my web.xml and faces.config.xml which I think are right.
> Would be nice to get a second opinion tho.

Ok.  The first problem is that web.xml elements are not in the correct order.
You're probably getting warnings about this, and this is probably a
large part of the problem as most of your configuration file is
probably being ignored.

This is the required ordering:

<!ELEMENT web-app (icon?, display-name?, description?, distributable?,
context-param*, filter*, filter-mapping*, listener*, servlet*,
servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?,
error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*,
login-config?, security-role*, env-entry*, ejb-ref*,  ejb-local-ref*)>

That is, context-params followed by filters followed by
filter-mappings followed by listeners followed by servlets followed by
servlet-mappings followed by security-constraints.

Your filter mappings will be executed in the order you list them.   My
recommendation would be to have the following myfaces extension filter
listed last, and during post-processing (after the Servlet runs), it
will run first, so you'll have a valid page at this point.

    <!-- extension mapping for adding <script/>, <link/>, and other
resource tags to JSF-pages  -->
    <filter-mapping>
        <filter-name>MyFacesExtensionsFilter</filter-name>
        <servlet-name>FacesServlet</servlet-name>
    </filter-mapping>


I would delete the following url-pattern mapping as it doesn't add anything.

    <filter-mapping>
        <filter-name>MyFacesExtensionsFilter</filter-name>
        <url-pattern>*.jsf</url-pattern>
    </filter-mapping>

The order of the following extensions filter mapping probably doesn't
matter, but you might get slightly better performance by listing it
first:

    <!-- extension mapping for serving page-independent resources
(javascript, stylesheets, images, etc.)  -->
    <filter-mapping>
        <filter-name>MyFacesExtensionsFilter</filter-name>
        <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
    </filter-mapping>

Reply via email to