aspose file tools*
The moose likes JSP and the fly likes Error Page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Error Page" Watch "Error Page" New topic
Author

Error Page

Luke Shannon
Ranch Hand

Joined: Sep 30, 2004
Posts: 239
Hello;

I have an error page configured in my web.xml file. However whenever there is a null pointer exception I get a blank page?

I can't figure out why my error page doesn't show up.

How can I configure my application so no matter what the exception my error page will be display?

Thanks,

Luke


Luke
SCJP
Patrick Mallahan
Ranch Hand

Joined: Apr 22, 2005
Posts: 69
find this in web.xml:

<error-page>
<error-code>500</error-code>
<location>/server_error.html</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/file_not_found.html</location>
</error-page>

basically need to change it for all the error codes, shouldnt be hard, because a null pointer is a 500 error so that should solve it.
Vince Hon
Ranch Hand

Joined: Feb 11, 2003
Posts: 117
could u post yr error page jsp ?


Vince Hon<br /> <br />SCJP 1.4 | SCWCD | SCBCD <br /><a href="http://vincehon.homeip.net:8000/VJW" target="_blank" rel="nofollow">http://vincehon.homeip.net:8000/VJW</a>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61662
    
  67

Vince, JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.

I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.

Please read this for more information.

thanks,
bear
Forum Bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vince Hon
Ranch Hand

Joined: Feb 11, 2003
Posts: 117
Beary, thanks for reminding me.
Arun Manivannan
Greenhorn

Joined: Jun 14, 2005
Posts: 5
Instead of the tag <error-code> you can optionally use <exception-type> tag...

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

I hope this would solve your problem..

Arun


SCWCD 1.4
Luke Shannon
Ranch Hand

Joined: Sep 30, 2004
Posts: 239
Here is my errorPage.jsp:

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Error Page