[jdom-interest] Best practices when using JDOM with XSLT and Servlets 2.2

Rob Finneran rob at digitalskyscrapers.com
Wed Mar 20 18:05:21 PST 2002


Hello,

I'm using xerces-j 2.0.1, xalan-j 2.3.1, with jdom b8-rc1. I'm also using
Jetty 3.1.3 which is a servlets 2.2 engine very simuliar to tomcat 3.2.

I dynamically build a JDOM tree from a database and I want to know the best
pattern for apply a javax.xml.transform.Templates to the JDOM tree
and then to send the result as html back to the browser.

Is the best method to use a SAX events outputter to a StringWriter() stream
and then to send the String back to the browser via the servlet's
Printwriter obtained via response.getWriter()? Doesn't the servlet buffer
the response anyway, so the StringWriter output stream would be redundant.

I've seen something mentioned about sockets in the FAQ and I saw Brett M's
example article, but I'm a little new to some of the java IO classes and
coding patterns.

Any steering would be appreciated!!!

TIA

Rob






More information about the jdom-interest mailing list