This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

error-page  RSS feed

 
Josef Oberckal
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
 
Roshini Sridharan
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • 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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!