On 9/21/06, Bertrand Delacretaz <[EMAIL PROTECTED]> wrote:
On 9/21/06, Yonik Seeley <[EMAIL PROTECTED]> wrote:
> On 9/20/06, Chris Hostetter <[EMAIL PROTECTED]> wrote:
> > ...isn't that what the "media-type" attribute of <xsl:output/> is for?
>
> Is it somehow possible to grab that and return it from
> RequestHandler.getContentType()?...
Yes, it works, thanks for the idea!
But this means that, in my XSLTResponseWriter, the Transformer object
has to be available in both the getContentType(...) and write(...)
methods.
What's the recommended way of storing the Transformer object so that
both methods can use it, in a threadsafe way? With plain Servlet
interfaces, I'd store it in a ServletRequest attribute.
We haven't had to yet :-)
I was going to suggest to just use your TransformerProvider
(transformer cache). But, the javadoc says that Transformer isn't
thread-safe.
One hackish way would be to keep the Transformer in a thread local.
But, it does seem like it could be useful to have a "context" or a way
of associating more info/objects with a particular request.
What do people think about a "Map getContext()" for a
SolrQueryRequest? It could be instantiated on-demand to avoid any
penalty for those not using it.
-Yonik