javajboss7.xseam2faces-configjboss-seam

Seam Navigation Rule. Catch all invalid url and redirect to a 404 page


I am using SEAM 2.3.0 (JBoss 7.1), trying to implement the following navigation logic:

For every *.xhtml that I don't catch in any page rule, forward to a 404.xhtml error page.

Something like this:

<page view-id="/*.xhtml"> <navigation> <redirect view-id="/404.xhtml" /> </navigation> </page>

But it's not working

For all url that have a wrongly written extension then the 404 page will displayed due to:

<error-page> <error-code>404</error-code> <location>/404.xhtml</location> </error-page>

in the web.xml.

Thanks in advance


Solution

  • I found the answer.

    <error-page>
        <exception-type>java.lang.Throwable</exception-type>
        <location>/404.xhtml</location>
    </error-page>