tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Todd Fast" <toddw...@conga.com>
Subject BUG: Broken RequestDispatcher.include()
Date Thu, 15 Jun 2000 13:37:01 GMT
Hi--

(First, forgive me for submitting this if these issues are already known--I
would've gladly searched for an existing bug/status, but the lack of a bug
reporting system makes it impossible for me to do so.  If these issues are
currently known, can someone please give me an idea of their status, when
they might be fixed, or if they are already fixed in an available build?)

There are two serious issues with RequestDispatcher.include() in version 3.1
that, as far as I can tell, makes using this method impossible:

1)  A call to RequestDispatcher.include("/HelloWorld/Page1.jsp") results in
an exception because Tomcat instead tries to find
"/HelloWorld/HelloWorld/Page1.jsp".  It doubles the first element of the
included resource path.  Note that forward() works as expected with the same
resource path.  The workaround seems to be to specify
"/HelloWorld/../Page1.jsp" as the resource path.  This might be workable in
the short term if it weren't for the next issue below.

2) Regardless of the Response's buffer size, doing an include() always
results in a committed response. The net result is that a developer can only
do a single include, and nothing else following it because any other
include() or forward() call results in an IllegalStateException.  I believe
the same behavior is occurs when calling forward().

For example:

    ... doGet(...)
    {
        System.out.println(response.isCommitted());
        response.setBufferSize(1000000); // huge number
        System.out.println(response.isCommitted());

        // include something here, like snoop.jsp ...

        System.out.println(response.isCommitted());

        // Another include or forward here always fails
    }

This code will always print:
    false
    false
    true

regardless of the buffer size.

Also, a related issue:

3) Certain error messages generated during processing of a servlet/JSP
result in an
IllegalStateException being thrown when Tomcat tries to write out the error
message to the output stream.  The error handling should understand enough
of what's going on to bypass this restriction.

Todd

--
Todd Fast
Senior Engineer
Sun Microsystems
todd.fast@eng.sun.com



Mime
View raw message