Hi fop users!

I have a servlet, which gets data from a sql database, puts it in xml and then
i transform the xml to xsl:fo and use the fop Driver to transform it to pdf and
send the pdf to the browser, using the following code snippet:

public void doGet(HttpServletRequest request, HttpServletResponse response) {

  Transformer transformer;
  Document myxml;
  ...
  Driver driver = new Driver();
  driver.setOutputStream(response.getOutputStream());
  driver.setRenderer(Driver.RENDER_PDF);
  response.setContentType("application/pdf");
  transformer.transform(new DOMSource(myxml),new
SAXResult(driver.getContentHandler()));
}

The transformer is equipped with the xml->xsl:fo stylesheet.

So all works fine, but I thought about speed issues:

in every doGet(..) call a new driver is created, and I think that is to slow
for a large number of users accessing the servlet.
But when i put the driver as a global variable in the servlet or maybe
servlet-context, what happens when two or more users want to access the driver?


bye, Peter

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

Reply via email to