Bug 38826 - spec violation?
Summary: spec violation?
Status: RESOLVED INVALID
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Servlet & JSP API (show other bugs)
Version: 5.5.12
Hardware: All Windows 2000
: P1 critical with 1 vote (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-02 02:41 UTC by deniX
Modified: 2006-03-02 04:48 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description deniX 2006-03-02 02:41:15 UTC
Hi all!

In Servlet spec, Filters section (SRV.6) I didnt found any
mentions that error-handling process should bypass filters.

My problem is:
I have lot of heavy-working jsps in my app (yes I know bad design etc but at the
moment there is no way to rewrite it). Sometimes, when one of jsps generated
200K of output the app-level error is encountered and is thrown to web
container. It should return the error-page + status-code of 500 but such a big
output in front of it leaded to "early" flush (status code 200 + part of html
response was already sent to client).

Such big amount of output data should be buffered to prevent "early" commit. I
created a bufferer-filter for this purposes. 
But when I finally got an exception and execution is passed to error page I see
that error-page don't use HttpServletResponseWrapper I defined in my filter.
Instead of it error-page works with unwrapped object
"org.apache.catalina.connector.ResponseFacade" and obviously bypass my filtering
logic.
Comment 1 william.barker 2006-03-02 02:51:24 UTC
<spec-quote version="2.4" section="9.9.1">
The original unwrapped request and response objects created by the container
are passed to the servlet or JSP page.
</spec-quote>
Comment 2 deniX 2006-03-02 13:41:01 UTC
(In reply to comment #1)
> <spec-quote version="2.4" section="9.9.1">
> The original unwrapped request and response objects created by the container
> are passed to the servlet or JSP page.
> </spec-quote>

I think I found another issue...
if the "exception-thrower" jsp contains <%@ page ...errorPage="error.jsp"%>
and it generates lots of output, I receive the 
SEVERE: Exception Processing ErrorPage[exceptionType=java.lang.Throwable,
location=/error.jsp]
java.lang.IllegalStateException
        at org.apache.coyote.Response.reset(Response.java:296)
        at org.apache.catalina.connector.Response.reset(Response.java:642)
        at org.apache.catalina.connector.Response.reset(Response.java:908)
it isnt quite good for me but at least it is understandable

what I think isnt is the following:
if there was a small output prior to exception occurence with conditions above
then error.jsp is working with wrapped request/response...

if I remove a explicit error.jsp form "page" attributes in jsp then error.jsp is
working with unwrapped request/response...
Comment 3 Tim Funk 2006-03-02 13:48:55 UTC
Bugzilla is not a support forum. 

Please do not reopen bugs for new issues. This bug will be re-marked as invalid
with respect to the original bug report. 

Feel free to open a new bug with the new issue.

But at this point - this seems to be a debugging exercise in user code. Please
use the tomcat-user list for help.