Pregunta

I have customized error code 403 (client error) through webapp i.e. adding entry in web.xml as below which works fine.

<error-page>
    <error-code>403</error-code>
    <location>/access-denied.xhtml</location>
</error-page>

I try to customise error code 500 (server error) with the above approach as below.

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

but this doesn’t work (getting jboss's original error message for error code 500 instead of error-500.xhtml) and I have no clue why, so I am left with only option to customize it through apache httpd and vhost config. Any idea why this is not working?

¿Fue útil?

Solución

The reason for not working is because the webapp has implemented ExceptionMapper that catches the exception instead of letting the custom error page to be resolved from web.xml

The resolution would be to remove the ExceptionMapper impl class.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top