tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: Doing multiple getOutputStream( ) commands.
Date Mon, 24 Jul 2000 17:29:25 GMT 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
"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
one or the other output method in your application (the general rule to
is "use the writer if you are writing text, use the output stream if you
writing binary").

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

Craig McClanahan

View raw message