You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Antonio Petrelli <an...@gmail.com> on 2009/02/25 13:59:04 UTC

Re: [tools-2.0] How to create HTTP-request-based application-wide tool

2009/2/25 Antonio Petrelli <an...@gmail.com>:
> I need to create a tool that is based on HTTP requests for Tiles 2. I
> succesfully did it through extending "ImportSupport" class, so I can
> access the request protected field.
> However, I don't feel comfortable with this solution, because this
> tool needs to be request-scoped and I need to create, at every
> request, a lot of objects that are potentially reusable.
> Is there a way to make this tool application-wide? Or is there a way
> (a repository?) to access a registered application-wide object,
> instead of creating it over and over?

I answer to myself, there is a really simple solution: using
ThreadLocal to store request, response and the Velocity context.
I hope I am doing the right thing :-D

Ciao
Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org