• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SkipPageException

 
Shivani Chandna
Ranch Hand
Posts: 380
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. If SkipPageException is thrown from child tag - is it the responsibility of the parent tag to cascasde it further?
-- It has been stated that parent tag should throw SkipPageException if it is being thrown from child tag or if SKIP_PAGE is returned from the child tag...


2. Given that the Error Page is defined. If SkipPageException (which is a subclass of JspException) is raised then the tag processing stops and the error page should be shown right? . If that is the case - then
(1) Why define a new exception class for stopping error processing - One could have thrown JspException only to stop the processing of the tag ?


Thanks,
Shivani
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it the responsibility of the parent tag to cascasde it further?
But given any uncaught exceptions are automatically propagated, won't this happen anyway? Presumably you haven't written any catching code.
Given that the Error Page is defined. If SkipPageException (which is a subclass of JspException) is raised then the tag processing stops and the error page should be shown right?
Before asking, have you actually tried this to find out what happens?
Why define a new exception class for stopping error processing - One could have thrown JspException only to stop the processing of the tag ?
This is a bit like asking why do we have ArithmeticException or NumberFormatException when RuntimeException would do, or IOException or ServletException when Exception suffices... using subclasses can be useful to distinguish (specifically) different types of exception conditions: for example, a SkipPageException might be handled differently by the container than a JspException... have you tried this to find out?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic