Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error-page

 
Ranjan Pwar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have given this in my web.xml:

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

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

According to HFSJ pg-470 heading (Declaring an error page for more explicit
exception) if we have both this declaration , any exception other
than ArithmeticException will still end up at "exceptionPage.jsp".

But when i run my application the page in which arithmeticexception
occured is showing exceptionPage.jsp instead of airthmeticPage.jsp.
when i remove the <error-page> element with <location> "/exception.jsp" then
it is showing \airthmeticPage.jsp.
I trid it in Tomcat5.5.27 and sun server

Please help me!
 
Kathiresan Chinna
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I got the same problem.
see here
http://www.coderanch.com/t/418662/java-Web-Component-SCWCD/certification/Declaring-error-page

Thanks
Kathir
 
Salim Khatib
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you try reversing the order or sequence of the exception

I mean More GeneralException(ie Throwable) to Specific Exception (ie Arithematic)

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

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


Please let me know the result
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"MS KHATIB",
Thank you for changing your name, but it still doesn't fit the naming policy requirements. You must use a real first and last name, and please do not use all capital letters. Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic