Design Query - Transforming XML

Discussion in 'Java' started by Roger Varley, Feb 3, 2005.

  1. Roger Varley

    Roger Varley Guest

    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
    Roger Varley, Feb 3, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dwhitford
    Replies:
    0
    Views:
    363
    dwhitford
    May 14, 2004
  2. Krista Lemieux

    Transforming XML with XSL to String

    Krista Lemieux, Aug 10, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    456
    Steve Flitcroft
    Aug 10, 2004
  3. Ken Adams
    Replies:
    1
    Views:
    696
    Arnaud Berger
    Mar 10, 2005
  4. Replies:
    0
    Views:
    354
  5. David Furey
    Replies:
    0
    Views:
    1,074
    David Furey
    Jun 29, 2003
Loading...

Share This Page