• 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
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

error-page

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

Problem 1)

This is part of my web.xml:

<error-page>
<exception-type>java.lang.NumberFormatException</exception-type>
<location>/errorNumber.jsp</location>
</error-page>

<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/error.jsp</location>
</error-page>

But when I throw a NumberFormatException from my JSP then error.jsp is called instead of errorNumber.jsp.

Problem 2)

In my error.jsp the statement ${pageContext.exception} will not print anything, although on top of the page I have <%@ page isErrorPage="true" %> and <%@ page isELIgnored="false" %>.

I am using Tomcat 5.0.28

Josef
 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since Throwable is the base class for all the Exception Type, i think the error.jsp page is executed.. why not use specific exception type to get rid of it. i.e. try it without using the throwable exception case.

Regards
Roshini.S
 
It will give me the powers of the gods. Not bad for a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic