• 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

 
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
reply
    Bookmark Topic Watch Topic
  • New Topic