• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

configuring error pages in DD

 
Jerret Halter
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working with configuring error pages in the DD and I read that it is possible declare an error page for a more specific exception. So I tried the following:



I went ahead and created a jsp to throw a java.lang.ArithmeticException, but everything I end up at the errorPage.jsp. Shouldn't this not be happening? My understanding was that with both of these error pages that any other error besides java.lang.ArithmeticException will go to errorPage.jsp
[ July 26, 2006: Message edited by: Jerret Halter ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've looked at the translated JSP page of Tomcat,
and it catches a Throwable in its _jspService() method and forwards it.
I think that's why you are redirected to the error page associated to Throwable exceptions.

The spec says :
The Web application may have declared error pages using the exceptiontype
element. In this case the container matches the exception type by comparing
the exception thrown with the list of error-page definitions that use the
exception-type element. A match results in the container returning the resource
indicated in the location entry. The closest match in the class heirarchy wins

So even with Throwable declared in web.xml, it should be ok.
I'm confused too. Maybe it's a bad idea to declare the Throwable error handling in web.xml
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's an entry here stating that it works with Sun Java System Application Server 8.1 :
http://www.coderanch.com/t/171560/java-Web-Component-SCWCD/certification/Catching-exception
 
Jerret Halter
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I am using tomcat 5.5xxx so now I know why its happening.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic