DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16319>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16319

RequestDispatcher.include in a customTag causes IllegalStateException





------- Additional Comments From [EMAIL PROTECTED]  2003-02-10 19:54 -------
Jasper wrapps the request into its own descendant of the 
HttpServletResponseWrapper. If the page included with <jsp:include> tries to 
aquire the writer, the wrapper hands over the original copy without getting a 
new one.

Using RequestDispatcher.include and passing the pageContext.getRequest() 
doesn't work that way, so that if the included page tries to get the 
writer/outputstream on its own it causes the IllegalStateException. 

I don't feel the included page should be rewritten: the HttpResponse object 
being passed comes from Catalina and I think it would be awkward to have to 
change the included page to take into account how Jasper and Catalina work 
together. Then switching the servlet container to another one might bring me 
into the same situation some time later on. I think the included jsp pages 
should have no knowledge which of the two objects (writer vs outputstream) can 
be safely used. Besides, there are good uses of outputstream where writer 
cannot be used instead.

My workaround was similar to that of Jasper, I did a HttpServletResponseWrapper 
descendant that makes the same trick and use it for the include stread of 
pageContext.getResponse().

Yet I think it is a bug: RequestDispatcher.include and Jasper's jsp:include 
should both work the same way.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to