users@glassfish.java.net

Re: Global 500 error page

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Tue, 17 Nov 2009 12:31:01 -0800

On 11/17/09 02:55, glassfish_at_javadesktop.org wrote:
> Hi
>
> I'm trying to set up a global 500 error page in my Glassfish server.
>
> I've my page into domains/domain1/config/error.html
>
> and I've added the following property to my virtual-server config:
> <property name="send-error_1" value="code=404 path=error.html reason=MY-404-REASON"/>
> <property name="send-error_2" value="code=500 path=error.html reason=MY-500-REASON"/>
> <property name="send-error_3" value="code=503 path=error.html reason=MY-503-REASON"/>
>
> 404 error page works. But 500 error page doesn't work,

Hmm, this seems to work fine for me.

I just amended our unit test:

  
https://svn.dev.java.net/svn/glassfish-svn/trunk/v2/appserv-tests/devtests/web/virtualServerSendErrorProperty

to also cover responses with a 500 status code, where the response is
generated
by a Servlet by calling

  response.sendError(500, "ABC");

or by throwing a ServletException. In either case, I get the reason
message and error page specified via
the send-error_x property.

Perhaps you can take a look at the above unit test and compare with what
you have?

Also, just FYI, the send-error_x property may be configured dynamically
(which is what the
unit test does), so there is no need to restart the server.

Thanks,

Jan

> I always get Glassfish's internal error page. (Not yet validated that 503 works)
>
> I've restarted the domain and the Glassfish server.
>
> What's wrong?
> [Message sent by forum member 'appel' ]
>
> http://forums.java.net/jive/thread.jspa?messageID=372126
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>