You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2003/04/17 17:39:17 UTC
DO NOT REPLY [Bug 19111] New: -
Response being committed on forward to error page
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=19111>.
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=19111
Response being committed on forward to error page
Summary: Response being committed on forward to error page
Product: Tomcat 4
Version: 4.1.18
Platform: Sun
OS/Version: OS/2
Status: NEW
Severity: Major
Priority: Other
Component: Unknown
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: andy@mediasurface.com
When Tomcat forwards to an error page, it seems to flush the output buffer even
if the buffer is not full. If the page is less than about 8K, it works fine:
the error is thrown, Tomcat fowards to the error page, the buffer is not
flushed, and the response is not committed.
The first JSP below sets the buffer size to 50k and then outputs 10000
characters. It then throws an error, which gets forwarded to the second JSP. By
the time the second JSP picks up, Tomcat has flushed the buffer.
Change the value in the for loop to about 8000 and Tomcat is OK.
SO it looks like Tomcat always flushes the output buffer at around 8k, rather
than the size of the buffer as set by response.setBufferSize().
1.jsp:
<%@ page errorPage="2.jsp" %>
Test committing/flushing
<%
response.setBufferSize(50*1024);
for (int i=0; i<10000 ; i++)
{
out.print(".");
}
if (true)
{
log ("About to throw. commited = " + response.isCommitted());
throw new Exception();
}
%>
2.jsp:
<%@ page isErrorPage="true" %>
In error page
<br>
commit = <%= response.isCommitted() %>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org