• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

handling exceptions

 
Anoopriya Muthuswaami
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which statements are correct about exceptions in servlets?

1) If there is defined an error page for an exception and a servlet included through a RequestDispathcer generates an exception, the standar mechanism of calling that error page is not used, so the calling servlet can process the excpetion.
2) The element in the DD used to specify where the error page can be found is: <url-pattern>
3) If a servlet generates an exception not defined in a error page then the servlet container sets the response status 500
4) If a servlet generates a ServletException or subclass and no match is found in the error pages defined in the DD then, the servlet container tries again to find a match with the wrapped exception which is obtained by calling ServletException.getRootCause().

Answer 1,3,4
I understand option 2 is incorrect and option 3,4 is correct. Can someone explain option 1.
[ December 11, 2008: Message edited by: Julian Justin ]
 
Ankit Garg
Sheriff
Posts: 9577
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Julian can you please Quote Your Source...
 
Anoopriya Muthuswaami
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ankit Garg:
Julian can you please Quote Your Source...


Its from http://www.javaranch.com/carl/SCWCD.htm
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic