On Wed, 8 Aug 2001, Sam Joseph wrote:
> Following up to my earlier post. I've now downloaded 3.2.3 and am getting the same
>error as with 3.2
>
> I had looked into the tomcat code underlying the error and it seems that the
>OutputStream is being
> requested from the HttpServletResponse more than once. Once by the servlet that is
>created to support the
> JSP and once by my own servlet.
>
> I'd happily not call the getOutputStream() method in my own servlet, but if I don't
>how can I send the
> output of the servlet to the JSP servlet it is embedded in?
>
The servlet spec says that, for any given response, you must use *either*
response.getOutputStream() *or* response.getWriter(). Because JSP uses
response.getWriter(), that means you should do the same in your servlet.
The only time you get IllegalStateException is when *both* are called on
the same response.
> Thanks in advance.
>
> CHEERS> SAM
>
Craig McClanahan