users@jersey.java.net

WebApplicationExceptions with response code >= 500 do not get passed back to the http container

From: Alex Treppass <alextreppass_at_googlemail.com>
Date: Fri, 16 Apr 2010 13:59:12 +0100

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,