[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Running transformations using JSTL

Subject: Running transformations using JSTL
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 25 Jul 2007 11:41:20 +0100
 Running transformations using JSTL
Does anyone have experience of running transformations using the JSP
Standard Tag Library?

I have a user who is attempting it, and is seeing symptoms that suggest that
the same Transformer is being used in more than one thread. This is
consistent with the JSTL spec, which says in section 13.1: 

"A more efficient approach is to process the transformation stylesheet once,
and then save this "transformer" object for successive transformations. The
specification allows implementations to support
transparent caching of transformer objects to improve performance."

But the JAXP Transformer is not reusable in this way. The Javadoc for
javax.xml.transform.Transformer says "An object of this class may not be
used in multiple threads running concurrently. Different Transformers may be
used concurrently by different threads." 

The object that should be cached is the Templates object, not the
Transformer.

Is it possible that jstl has got this wrong? It would seem a surprisingly
grave blunder. Perhaps in the Xalan implementation the Transformer object
can be safely reused across threads, despite the JAXP specification saying
it can't?

Any insights welcome.

Michael Kay
http://www.saxonica.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.