tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: Doing multiple getOutputStream( ) commands.
Date Mon, 24 Jul 2000 17:29:25 GMT
Paul_Craven@nas.adp.com wrote:

> I have a servlet that outputs some html, then calls RequestDispatcher to
> include another file. This doesn't work with Tomcat, because Tomcat throws
> an exception that outputStream is already in use.
>
> I don't see anything in the specs that says I can't do what I am trying.
>

The specs say that, if you used the output stream in the "outer" servlet
or JSP
page, then you can only use the output stream (and not the writer) in
the
"included" servlet or JSP page.

Likewise, if the outer servlet uses the writer, then the included
servlet can
only use the writer.

Tomcat is correctly implementing these spec requirements.  You need to
choose
one or the other output method in your application (the general rule to
follow
is "use the writer if you are writing text, use the output stream if you
are
writing binary").

>
> Thanks,
>
> Paul Vincent Craven
> Quality Consulting, Inc.

Craig McClanahan

Mime
View raw message