• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

<error-page> tag in web.xml is not working

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Following tag in web.xml is not working for me. I am using Tomcat 5.5 and JDK 5.

<error-page>
<exception-type>java.lang.NullPointerException</exception-type>
<location>/UserAuthentication/error.html</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/UserAuthentication/error.html</location>
</error-page>

Instead of showing the error.html, I am getting 404 Page not found on Browser.

Please guide me on this.
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Details. We always need details!

Which browser? If it's IE, that's a known problem with IE.
 
Ruturaj Varne
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes.. It is IE 7. But I tried the same thing on Mozilla Firefox Browser also and getting the same result.
 
Bear Bibeault
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does the file /UserAuthentication/error.html exist relative to the context root?
 
Ruturaj Varne
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes.
 
Bear Bibeault
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then it should work.

If all you are going to give is single-word answers, there's not much else to say.
 
Ruturaj Varne
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I placed error.html inside the Userauthentication directory of Tomcat/ Webapps. I thought that /UserAuthentication/error.html will not work. So hit this link in browser just to confirm that the path is correct. I read one thread in this forum which tells that there is need of change in configuration of IE. That also i tried but the output is same. BLANK PAGE. So i think everything is at its proper place. So i am confused now and having only one question in mind that WHY THIS IS NOT WORKING.
I am expecting whenever there is 404 error then browser should show me the error.html. But it is not showing anything. Now please tell me.
 
Bear Bibeault
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ruturaj Varne wrote:Well, I placed error.html inside the Userauthentication directory of Tomcat/ Webapps.


Then you answered my question incorrectly. The file path is not relative to the context root. This is why a single-word answer isn't a good idea.

If /UserAuthentication is the context path, it doesn't get specified as part of the file path. The container knowns where the context path is; you don't repeat it.
 
Ruturaj Varne
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now i tried the following

<error-page>
<exception-type>java.lang.NullPointerException</exception-type>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/error.html</location>
</error-page>

Still it is not working.
 
Bear Bibeault
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You changed 404 to 500. Are you seriously looking for help, or just yanking chains?
 
Ruturaj Varne
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I added both of them (404 and 500). I am just doing some R&D work so that this <error-page> thing will work. Thats why i added 500.
 
Bear Bibeault
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'll need to post your web app file structure and the deployment descriptor. Please be sure to use code tags to preserve formatting.
 
Ruturaj Varne
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
send me your mail id ... i will send you everything..
 
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
UseTheForumNotEmail. You'll get more help by posting your directory structure and deployment descriptor here.
 
Ruturaj Varne
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is an attachment of web.xml.
 
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
You cannot attach such file. Please copy/paste it here. (Insert it between [code] [/code] tags)
 
reply
    Bookmark Topic Watch Topic
  • New Topic