Hi there,
i have a jsp which runs just fine under tomcat 5.5.9 but throws an exception in 
tomcat 5.5.12 and 5.5.15.
Here is a part of the code:

----code snippet----
ByteArrayOutputStream baos = new ByteArrayOutputStream();
                //creates a pdf out of the baos
                pdfPrinterEB.createPDF(baos);
              response.setContentType("application/pdf");
                //set Header Information
            response.setHeader("Content-disposition", "inline;                  
  filename="+pdfPrinterEB.getFileName());
            response.setHeader("Cache-Control", "no-cache");
            response.setHeader("Pragma:", "no-cache");
        response.setContentLength(baos.size());
        try {
            ServletOutputStream servletOut;
            servletOut=response.getOutputStream();             
                baos. writeTo(servletOut);
            servletOut.flush();
        } catch (IOException ex) {
        }  
----codesnippet----

The following exception occurs:

----exception----
08.03.2006 12:20:51 org.apache.catalina.core.StandardWrapperValve invoke
SCHWERWIEGEND: Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for 
this response
        at org.apache.catalina.connector.Response.getWriter(Response.java:606)
        at 
org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:195)
        at 
org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:124)
        at 
org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:117)
        at 
org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:191)
        at 
...
...
----exception----

Like I said before, the code works for Tomcat 5.5.9, neither getOutputstream() 
nor getWriter() are called at any place in the application.

Markus Alvermann


 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to