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

changing status code

 
Sharma Anjali
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HF Pg 405

First A:


There are a few limitations though. An included page cannot change the response status code or set headers.


Is this only true for only <jsp:include> or both <jsp:include> and include directive
[ February 22, 2005: Message edited by: Sharma Anjali ]
 
Yogananth
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The restriction you have mentioned is applicable only for <jsp:include>. In this page, current page would be translated & compiled into a seperate servlet and the page that is included would be converted into a seperate servlet. And the seond servlet would be invoked by getting the request dispatcher for that servlet & invoking include method in the dispatcher.

But in the case of "include" directive, both the pages are translated into a single servlet and there will not be any RequestDispatcher call. And thus you can have code that modifies response header or status in either of the pages.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic