> From: Leon Rosenberg [mailto:[EMAIL PROTECTED] 
> Now I have the unpleasant
> situation that i need some information pretty deep in some use cases
> of the application (like current locale) which I only have at the top
> (servlet) level.

We had the same issue with an app.  Provided you remember that Tomcat
re-uses threads, this isn't actually that much of a problem if all of
your processing is done on the request's thread.  Simply use a global
class with a ThreadLocal
(http://java.sun.com/j2se/1.4.2/docs/api/java/lang/ThreadLocal.html)
instance variable holding your extra data.  Because of re-use, remember
to nil the variable at the start of your processing, possibly even in a
Filter if you're feeling paranoid.

We took that approach.  I'll be interested to hear of any others.

                - Peter

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to