Caldarale, Charles R wrote:

It's my understanding that servlet 2.5 loosened the requirement that a
included/callee Servlet (and JSP?) cannot set the resp headers/status,
and should now be able to set them if not already committed.

Here's the exact text from SRV.8.3 of the servlet spec version 2.5mr6:

"It cannot set headers or call any method that affects the headers of the response, 
with the exception of the HttpServletRequest.getSession() and 
HttpServletRequest.getSession(boolean) methods. Any attempt to set the headers must be 
ignored, and any call to HttpServletRequest.getSession() or 
HttpServletRequest.getSession(boolean) that would require adding a Cookie response header 
must throw an IllegalStateException if the response has been committed."

 - Chuck


Thanks for replying Chuck. Do you know if that rule applies only to the Request object passed by the RequestDispatcher, or should the container also prevent this if the original Request was purposely passed into the dispatched handler, in order to allow it to set headers/status?

Ken



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to