Design Query - Transforming XML

R

Roger Varley

Hi

I currently have a servlet that performs an XSLT transformation with a
Template object (created in the servlets init() method) using the
contents of the HttpInputStream and then attaches the output to an
e-mail message. I want to break out the transformation and send into a
seperate class so that a) it's not dependant on the servlet and b) make
it easier to test.

In my new class I want to create the Template object once and share
that with all invocations of the class so if I create the Template
object in a static initialisation block and then call it from my
servlet doPost() method with something like new
myObject.transform(InputStream) will this a) work and b) will the
Template object work as expected (the javadocs say that the Template
object is threadsafe - but I'm not sure if doing it this way amounts to
the same thing)

Regards
Roger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top