• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

unable to configure custom error pages

 
Ranch Hand
Posts: 56
Android Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,
I am using tomcat 5.0.16 and i used the following code to configure error pages in web.xml:

When an exception occurs, then my custom page is being displayed. But the page configured with the error code doenst display when i request for a non-existent resource such as a jsp.
Can anyone point to whats wrong with my config code?

Regards
Dinkar
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On which browser did you try it ? Please try both Firefox and IE is you can.
 
Dinkar Chaturvedi
Ranch Hand
Posts: 56
Android Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But I thought that when the error occurs on the server end, then the server will generate an error page and send it to the browser. If we have configured an error page, then the server should pick up the appropriate page and send it across.
How is it related to the browser?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IE has a nasty option to show its own error messages. I don't know the english name for this option. It's in Tools/Internet Options/Advanced/". Maybe called "Show friendly HTTP messages"
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Found it with Google. It's an option called "Show friendly HTTP error messages". Turn it off.
 
Dinkar Chaturvedi
Ranch Hand
Posts: 56
Android Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But what is bothering me is the fact that the error page that is being displayed is coming from tomcat and not being displayed by IE.
Its the usual one that you get to see when you try to access a resource that doesnt exist.
The bottom line tells its coming from apache..
here is the code of the page produced: I am sure its being sent by tomcat..

<html><head><title>Apache Tomcat/5.0.16 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /scwcd/no.jsp</h1><HR size="1" noshade><p><b>type</b> Status report</p><p><b>message</b> <u>/scwcd/no.jsp</u></p><p><b>description</b> <u>The requested resource (/scwcd/no.jsp) is not available.</u></p><HR size="1" noshade><h3>Apache Tomcat/5.0.16</h3></body></html>


My problem is why is tomcat sending its own error page when i have configured my page to be displayed? Is there anything wrong with the configuration code that i have written in the first post?

Regards
Dinkar
[ April 16, 2007: Message edited by: Ben Souther ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I can't get that one. Do you have a file called "/catchError.jsp" ?
You obviously have one called /catchAllError.jsp, but do you also have one called catchError.jsp ?

If you could also try with a newer version of Tomcat...
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Normally, we stress using the UBB code tags.
If, however, your entire page is written on one line, doing so will make the thread even harder to read.

Please take the time to format your code before posting to the forum.
Doing so will increase your chanced of getting a quick and accurate answer to your question.
[ April 16, 2007: Message edited by: Ben Souther ]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using tomcat 5.5.20 and got the same issue:

If you configured conf/web.xml you need to place this jsp under ROOT package and under each web application as well.

Hope it helped.
 
Oh the stink of it! Smell my tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic