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=8831>. 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=8831 ErrorReportValve.java corrupts data in subtle way [EMAIL PROTECTED] changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|WONTFIX | ------- Additional Comments From [EMAIL PROTECTED] 2002-05-06 22:44 ------- Looking at revision 1.9 of ErrorReportValve.java, which is the most recent in ViewCVS, I see the following in report() method: // Do nothing on a 1xx status if (statusCode < 200) return; // Do nothing on an OK status if (statusCode == HttpServletResponse.SC_OK) return; // Do nothing on a NOT MODIFIED status if (statusCode == HttpServletResponse.SC_NOT_MODIFIED) return; // Do nothing on a NO CONTENT status if (statusCode == HttpServletResponse.SC_NO_CONTENT) return; I don't see anything to confirm the statement, "For the statuses <400, when the response is not an error and the exception is null, it is a status report (a convinience feature)." The only response codes that are passed along unharmed are 200, 204, and 304. There appears to be an intention to see if the response code is an "error" in the call to hresponse.isError(), but that is commented out. Please confirm the following: 1. If my servlet returns a 207, ErrorReportValve will still consider this to be an error, and continue down the code path to generate an HTML response (regardless whether it is error report or status report). 2. The only reason that my output will not be changed is due to the following sequence of events occur in the right order: - my servlet calls HttpServletResponse.getOutputStream() - therefore later calls to getWriter() fail - as a result response.getReporter() either returns null or throws exception - this blasts us around the block (i.e. dodge a bullet) Stated another way, the possibility of data corruption still exists: If my servlet had instead called getWriter() instead of getOutputStream(), then response.getReporter() would not have returned null, and so the content-type would be forcibly changed, and the generated HTML would be written to the client. It seems to be very counter intuitive to have the container behave one way if you just so happen to call getWriter() than if you call getOutputStream(), no? Please show where I am wrong. -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>