Re: Embedding rtf output in servlet response

Bertrand Delacretaz <[email protected]> Wed, 20 Nov 2002 12:32:18 +0100
Newsgroups gmane.text.xml.jfor.general
Organization codeconsult
Message-ID <[email protected]>
Bonjour Theo,

Let's go for english so that most people can follow ;-)

>. . .I tried to get the RTF output into a
> stream and print it on screen via a browser, without create physical file.

Instead of saving the output to a ByteArrayOutputStream, you should be able 
to write it directly to the HttpServletResponse's output, something like

  final OutputStream out = response.getOutputStream();
  response.setMimeType("application/msword");
  new Converter(input,out,...);
  out.flush();

But first make sure your xmlString contains a valid xsl-fo document for jfor, 
by testing it outside of your servlet environment first.

Hope this helps!

-Bertrand


-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html