my dog learned polymorphism*
The moose likes Websphere and the fly likes custom 404 and 500 error pages in was 6.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "custom 404 and 500 error pages in was 6.0" Watch "custom 404 and 500 error pages in was 6.0" New topic
Author

custom 404 and 500 error pages in was 6.0

nancy cochran
Greenhorn

Joined: Feb 10, 2006
Posts: 10
How do I configure the WAS server to use custom 404 and 500 error pages for web applications? The associated Apache server is configured to use these pages and it is working. How do I get the WAS server to use these pages when an error occurs in a WAS deployed web application?

Or is this even possible? Does the error monitoring have to be done within the application itself?

Thanks in advance for responses.
Brian Hennessy
Ranch Hand

Joined: Oct 24, 2005
Posts: 57
Hi
I generally do this within the application itself. If you double click on the web.xml file in WebSphere Sudio there is a tab option to Pages , in here there is an error pages section and you can map HTTP response codes to customized error pages in your app.
nancy cochran
Greenhorn

Joined: Feb 10, 2006
Posts: 10
Thanks for your response. I think that is what I will end up doing. Probably I'll have my error pages redirect to external server level generic error pages. I'll have to play a little. Thanks for the suggestion.
Jos Cenens
Greenhorn

Joined: Jun 28, 2006
Posts: 2
Hi,

I show custom error pages via the HTTP Apache 6 server (httpd.conf) file. It works as far that a page can't be found (error 404) or the application server itself is down (error 500). But when I have to deploy (update) an application in websphere and I stop the running application then is gives a default error 404 page. How do I have the configure the application server when a application is stopped to show my custom error page and not the default error page?

greetings Jos
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30749
    
156

Jos,
Welcome to JavaRanch!

By definition, you can't do anything within your application to show a message when the application is down. Instead, you have to do something on the web server.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jos Cenens
Greenhorn

Joined: Jun 28, 2006
Posts: 2
Hi Jeanne,

on the web server (HTTP Apache) I configured the httpd.conf file and it works, but not when I stopped the appliction in WebSphere. Do you have more information about the settings I have to for see? I work with a plugin-cfg.xml so when the application server itself is not down and the application is stopped, I get a default error page 404, instead off my Custom error page. Then the internet users have to wait the time I need to install or update the application. In IIS it is very simple, maybe it is also simple in Apache but I can�t find it (Googeled a lot). If you can help me, I thank you.

Kind regards
Jos
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30749
    
156

Jos,
Unfortunately, I can't be of further help. "you have to do something on the web server" is the extent of my knowledge on this. The nice technical word being "something" . I haven't actually done it.

When you do find out what to do, please post a reply to this thread to help others.
Rinat Matityahu
Greenhorn

Joined: Jul 05, 2006
Posts: 4
Would not think it is possible to use 404 within application itself - if it's down, you'll never get there.

I am myself looking for hints on how to configure customize 404 pages on WebSphere (If possible, per app)

Cheers
studentForever forever
Greenhorn

Joined: Sep 23, 2008
Posts: 1
Did anyone ever figure out how to do this? I am trying to do the same thing... return my custom error message when an application within websphere is down.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: custom 404 and 500 error pages in was 6.0