Win a copy of Getting started with Java on the Raspberry Pi this week in the Raspberry Pi forum!
  • 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
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

error pages in dd

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a problem with error pages in DD.
I tried to cause an arithmetic Exception (10/0) and thought I will get my errorPage arithmeticError.jsp but always get the errorPage for Throwable: errorPage.jsp when calling badPage.jsp. What is wrong ??

badPage.jsp
<html><body>
<h1>Bad Page</h1>
<% int x=10/0; %>
</body></html>

errorPage.jsp
<%@ page isErrorPage="true" %>
<html><body>
<h1>Error !</h1>
</body></html>

arithmeticError.jsp
<%@ page isErrorPage="true" %>
<html><body>
<h1>arithmetic Error !!</h1>
</body></html>

web.xml
<error-page>
<exception-type>java.lang.ArithmeticException</exception-type>
<location>/arithmeticError.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/errorPage.jsp</location>
</error-page>

Thanks,
Kathrin
 
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried to remove the declaration for the throwable exception?
 
Kathrin Sann
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, then I get arithmeticError.jsp.
But I thought, the container would recognize the kind of Exception and choose the nearest ?
Kathrin
 
You don't know me, but I've been looking all over the world for. Thanks to the help from this tiny ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic