Error page with class inherited from RuntimeException


In my JSF project (with primary structs), I have defined an error page in web.xml to display when java.lang.Exception is called.

<error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>/erreur.xhtml</location>
</error-page>

      

This works great when a RuntimeException is thrown (the file erreur.xhtml is displayed).

I also created a class (called TechnicalException) inherited from RuntimeException. When a TechnicalException is thrown, I cannot explain why the error page is not displayed. Same case when I specify "TechnicalException" in the "exception-type" tag of web.xml.

When a TechnicalException is thrown, the request is still processed (tab icon in processing mode) until the session times out.

Do you have any idea about this behavior?

+3


source to share


1 answer


I might have an idea: if you override the getCause () method, it could result in a loop. Check the getCause () method and avoid "return this;"



Julien

+2


source







All Articles