GeeCON Prague 2014*
The moose likes JBoss/WildFly and the fly likes Overriding HTTP 403 Error Pages in JBoss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Overriding HTTP 403 Error Pages in JBoss" Watch "Overriding HTTP 403 Error Pages in JBoss" New topic
Author

Overriding HTTP 403 Error Pages in JBoss

Arvind Prabhu
Greenhorn

Joined: Aug 09, 2001
Posts: 18
Does anyone know how to provide JBoss with a custom error page to display for various HTTP error codes? HTTP 403 in particular.
I know that you can specify (in web.xml) the following for each web application deployed under JBoss ...
<error-page>
<error-code>403</error-code>
<location>error403.html</location>
</error-page>
But that limits the error handling to that web application. I want to configure this at a server level.
Thanks,
-Arvind
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 566
Try putting it in the default web.xml in the tomcat.sar directory in your deploy directory.


I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
Arvind Prabhu
Greenhorn

Joined: Aug 09, 2001
Posts: 18
Thanks for the quick response and suggestion, but ...
I have JBoss 3.0.x (bundled with Tomcat 4.1.x), and ...
Under the deploy directory, there is a "http-invoker.sar" directory under which there is a "invoker.war" directory. And then in that directory there is a WEB-INF directory with a web.xml file. I added the error-page declaration there; however, it didn't work.
Any thoughts?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Overriding HTTP 403 Error Pages in JBoss