Skip to main content

Change page marked "Forbidden" when resource not accessed to our branded page

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
3 replies [Last post]
dkavanagh1718
Offline
Joined: 2013-03-05

Hello,

We need to change the page that is displayed when a forbidden resource has been accessed so that we it can carry our branding.

Now Glassfish uses default branding which is white page with black text saying

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Lachezar Dobrev

That's to be done by the web application developer using
tag in the web.xml.

2013/3/5 :
> Hello, We need to change the page that is displayed when a forbidden
> resource
> has been accessed so that we it can carry our branding. Now Glassfish uses
> default branding which is white page with black text saying “forbidden”.
> Any ideas gratefully appreciated………… Thank You
>
> --
>
> [Message sent by forum member 'dkavanagh1718']
>
> View Post: http://forums.java.net/node/895415
>
>

swchan2
Offline
Joined: 2005-03-29

"forbidden" corresponding to error code 403. And one can configure the error page in web.xml.
For instance, adding the following code in your web.xml

403
/error403.jsp

swchan2
Offline
Joined: 2005-03-29

I have tried to add a xml code snapshot in the post message. But it was
removed.
The xml element that you need to add is error-page, error-code and location.

On 3/5/13 10:44 AM, forums@java.net wrote:
> "forbidden" corresponding to error code 403. And one can configure the
> error
> page in web.xml. For instance, adding the following code in your
> web.xml 403
> /error403.jsp
>
> --
>
> [Message sent by forum member 'swchan2']
>
> View Post: http://forums.java.net/node/895415
>
>