tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mel Martinez <melaqu...@yahoo.com>
Subject TC3.2.1 - response commit on included JSPs
Date Wed, 21 Feb 2001 04:43:03 GMT
Hi folks,

I've spotted what looks like a bug in the jasper
compiler of TC3.2.1 - if this is old news, just let me
know and I'll shut up.

There are two parts to this:

1) the _jspService() method generated by the jasper
compiler uses a try{ ... }catch{...}finally{...}
block.  The finally clause looks like so:

 }finally{
   out.flush();
    _jspxFactory.releasePageContext(pageContext);
 }

Q: shouldn't the their be a check to see if the
current request is the result of a dynamic include
before we flush the buffer?

2) Examination of
org.apache.jasper.runtime.JspWriterImpl and the
response classes shows that flush() has set the
response.isCommitted() flag of the HttpServletResponse
object before response.flushBuffer() has been called.

Q: JavaDoc for the ServletResponse.flushBuffer()
method implies that it should be the one to set the
'committed' state of the response object:

"Forces any content in the buffer to be written to the
client. A call to this method automatically commits
the response, meaning the status code and headers will
be written."

Without getting stuck on the details of either of the
above issues, the real issue is that as it stands
above, if you do a dynamic include of a JSP page then
the response object is committed upon the return of
the method.  I don't believe that is correct behavior.

Is this fixed in a later release?  If so, which one
should I upgrade to?

Thanks,

mel

Dr. Mel Martinez
G1440, Inc.

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/

Mime
View raw message