Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SkipPageException - Doubt

 
Manikandan Jayaraman
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a code snippet given to demonstrate SkipPageException in HFSJ, page 515. I have a dount on that.

I have answered it right as shown in the page 516, but I thought the behavior of SkipPageException might depend on whether jsp:include is used (or) include directive.

I mean ...

jsp:include results in a dynamic content generation and separate servlet for the included file (page B) and thus exception in that page B (_jsp.java) will end there itself and will not affect the parent jsp (page A) i.e the _jsp.java file.

Where as, <%@ include ... results in a single servlet at the translation time and thus any SkipPageException thrown in the pageB will stop the rest of contents in page A from being displayed.

Am I right here ? Can anyone give me a valid answer?

I am trying to replicate this in code but it will be fine, if someone can answer in between.

Regards,
Mani
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Where as, <%@ include ... results in a single servlet at the translation time and thus any SkipPageException thrown in the pageB will stop the rest of contents in page A from being displayed.


I think you are right. in case of ibclude directive, there is no page B. The content of B is copied into page A. So the SkipPageException will throw from PageA not from page B, as the page B is not running seperately.

Thanks
 
Steven Colley
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
right, i agree too.

The "page B" is just a fragment of code wich is included by page A. Therefore,"page a" is the only one (and real) page. (for container).

cya
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic