tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 5957] New: - RequestDispatcher.include() not working with wrapped responses
Date Tue, 29 Jan 2002 04:04:20 GMT
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=5957>.
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=5957

RequestDispatcher.include() not working with wrapped responses

           Summary: RequestDispatcher.include() not working with wrapped
                    responses
           Product: Tomcat 4
           Version: Nightly Build
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: plesser@ucs.at


If a filter is installed that wraps the response in a ServletResponseWrapper
jsp:include does work, but not using a RequestDispatcher's include()-method 
from either a servlet or a jsp. The result are empty pages.
I think the org.apache.catalina.core.ApplicationDispatcher and its re-wrapping 
of responses is the cause, using the setResponse(..) method on 'my' wrapper and 
writing it to its encapsulated response object rather than its outputStream.
For a short example please send me an email and i'll mail it to you.

------- Additional Comments From plesser@ucs.at  2002-01-22 14:57 -------
Created an attachment (id=1050)
demo of this bug, go to localhost:8080/rdbug/incl.jsp and watch the console


------- Additional Comments From craig.mcclanahan@sun.com  2002-01-29 04:04 -------
Thanks for the test case!  On initial analysis, it appears to me that this might 
be an application error, rather than a Tomcat problem.  Here's my reasoning:

* Your filter creates a wrapper that creates a custom ServletOutputStream,
  which in turn creates a DataOutputStream around the underlying "real" stream.

* When your application calls response.flushBuffer(), the wrapper calls
  super.flushBuffer() on the parent wrapper, but it does *not* call
  output.flush() on the custom ServletResponseStream.

* Therefore, any data inside the DataOutputStream will be omitted.

Does this make sense, or am I missing something?

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message