users@glassfish.java.net

Re: Custom Error Pages

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Mon, 24 Aug 2009 18:07:14 -0700

Eric,

On 08/24/09 10:24, Eric Knittel wrote:
>
>>
>> Hi All,
>>
>> Can someone please tell me how to change the default error pages in
>> glassfish? Specifically, I want to use a custom 401 Error page. If
>> you can please tell me in simple terms (I'm not a glassfish guru).
>>
>> Also, please reply directly, as I am not on the alias.

Mapping of error pages is defined by the Servlet spec, and is not
specific to GlassFish.

You need to add an error-page declaration to your web application's
deployment descriptor, as follows:

    <error-page>
        <error-code>401</error-code>
        <location>location_of_your_custom_error_page</location>
    </error-page>


Jan

>>
>> Thanks in advance,
>> Eric
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>