File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes Global redirection for HTTP errors 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 "Global redirection for HTTP errors in JBoss" Watch "Global redirection for HTTP errors in JBoss" New topic
Author

Global redirection for HTTP errors in JBoss

Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329

Hi there,
I thought for a while to place this post here or in security forum but I decided to do it here. The problem is as below,
We have an application running on JBoss 5.0.1. While some HTTP status errors occurs (say for example 404) it gives the http error page saying the version of the JBoss web server (ex: JBoss Web/2.1.2.GA). Is there any way other than using configuration in deployment descriptor to redirect this or handle in some other way. Basically looking for configuration at the level of the port on which JBoss is running rather than at the context level

Thanks in advance


Have Fun with Java
little,little.. little by little makes a lot..
Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329

Anybody there?

Latest Update:
We have configured the deployment descriptor in ROOT.war to redirect the user to some HTML on some errors and it works fine. For example, if I give http://localhost:8080/junkkk.html which doesn't exist, now it is redirected to the custom server error HTML provided.
code used is like Now that there are so many such error codes too much configuration changes are required. On top of that, say if I have three applications to be deployed in the JBoss, I have to configure 3 more times (in each web.xml) and it sums up to 4. Is there a way out?
At least is there a way to minimize the error codes in configuring(some generic way).
Thanks in advance,
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

There is no central location to do this for all apps, you have to do it for each app separately.

I think I recall a discussion about this earlier, where the global web.xml was edited to contain the <error-page> entries but still each web app had to have a copy of the error page (because the error page is relative to the apps context).


JBoss In Action
Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329

Thank You Peter, Ha! looks like maintaining a web application is never going be so easy forever, as we never get satisfied..
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Global redirection for HTTP errors in JBoss