You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by DARIOL Rodolphe DvSI/SIFAC <ro...@francetelecom.com> on 2001/11/16 09:12:35 UTC

Impossible to write the response after processing a JSP with Tomcat 3.2.3

Bonjour,

I want to generate a PDF file from a JSP with a servlet doing this :

    - call a JSP and redirect the ouput to a HTML file,
    - then, transform the HTML to a PDF file via HtmlDoc,
    - finally, open then PDF and send it to the client.

The output is redirected to a HTML file whith a tag in the JSP
like this :
JSP : <% out = .... >

The HtmlDoc programm is call as an external process.

I'm getting the ServletOutputStream from the response and write the
PDF stream into it.


This treatment works fine with Tomcat 3.1, BEA WebLogic 5.1 and 4.5,
IBM WebSphere 2.03 and 3.02 (there's another problem whith WebSphere
3.5).


When I try it with Tomcat 3.2.3, the browser complains that the
document contains no data.


After debugging and reading the code, I see that the problem is
comming from the forward method (doForward in reality) of the
RequestDispatcherImpl whitch close the ServletOutputStream and, then,
the servletoutputstream writing has no effect.


As I didn't see in the specs that it's impossible to write on the
ServletOuputStream after calling a JSP, I don't know if it's a bug.

But, anyway, if it's possible, I would like any comments or suggestions
about doing this treatment in a better way.

Thanks in advance.

-- 
Rodolphe Dariol
Quelque temps qu'il fasse en novembre,
commence le feu dans ta chambre.

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>