velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Petrelli <antonio.petre...@gmail.com>
Subject Re: [tools-2.0] How to create HTTP-request-based application-wide tool
Date Wed, 25 Feb 2009 12:59:04 GMT
2009/2/25 Antonio Petrelli <antonio.petrelli@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


Mime
View raw message