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
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