On Wed, 2009-07-15 at 22:58 +0200, Tobias Reinhardt wrote:
> Hi
>
> I am trying to output a PDF with a template of type servlet. I get the
> "getWriter() has already been called for this response" Error when I
I think the message is pretty clear ... the getWriter() method has been
already called. You can't use both getOutputStream() and getWriter() on
the response ... it seems in 4.1 some filter or servlet executed before
your servlet has already called getWriter() on the response so you can't
use getOutputStream() anymore ... either find out which filter/servlet
called it and disable it or put your servlet in front of it ... or use
getWriter() method and work with a writer in your servlet rather then
with OutputStream ... There are wrappers around that let you wrap Writer
into OutputStream and vice-versa so you can use that to work around the
issue.
HTH,
Jan
> call response.getOutputStream(). I reduced the servlet to the bare
> minimum.
>
> public class TestServlet extends HttpServlet {
> public void doGet(HttpServletRequest request, HttpServletResponse
> response) throws IOException, ServletException {
> response.getOutputStream();
> }
> }
>
> This servlet does generate the error on 4.1, but it does not generate
> an error on 3.6.5.
>
> Any ideas?
>
> Tobias
>
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
--
Best regards,
Jan Haderka
Magnolia International Ltd.
Meet us at the Magnolia Conference
http:/www.magnolia-cms.com/conference
Magnolia® - Simple Open Source Content Management
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------