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

jsp:forward question...

 
James Turner
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I just would like some clarification, when a jsp:forward action is executed, the JSP page the contained the action is finished. Control never returns to the page.

I ask this because the I am wondering if maybe the remainder of the JSP is just ignored, or if control does not come back to it at all.

Thank you for your help.

Regards,
James
 
Nitish Bahadur
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Control comes back, because function calls are implemented using a stack, but the response is not affected. This is easier to test using a Servlet. Do a RequestDispatcher.forward and use a System.out.println() after that. This is not so apparent in JSP because the <jsp:forward> when converted to Servlet adds a "return", at least in Tomcat.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic