In Jersey, WebApplicationExceptions with response codes < 500 are passed to
the http container, allowing the http container to generate / use a custom
error page with our web application's look-and-feel and a user-friendly
message. We're using <error-page> declarations in our Tomcat's web.xml to
achieve this.
It seems that WebApplicationExceptions with response code > 500 are instead
processed by ContainerResponse.onException(Throwable e, Response r, Boolean
mapped), which generates a Jersey specific error page at line 455. The
generated error page body is a server-side strack trace giving out quite a
lot of implementation / internal info. This behaviour is preventing us from
mapping static custom error pages with the server with our application's
look and feel for http status codes >= 500.
We're using Jersey 1.1.5.
Regards,