mercredi 29 juillet 2015

Tomcat Custom Error Servlet

I have a custom error handling servlet which catch all throwables :

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

The thing is, this servlet will do the forward request of the resolution and set some custom response headers. I want it to also set the http status code appropriately but it seems like if I set the http status code to the response, then I call forward, the response code automatically goes to 500.

why?

Aucun commentaire:

Enregistrer un commentaire