I don't know of a way to access the session from your business logic
other than passing it in as a parameter (which I would *NOT*
recommend).  Even if you could access it, you would be tying the
business layer to the servlet api, which is what you are trying to
avoid by not passing the session directly.

Take a look at ThreadLocal, I've never used it but it should do what
you want. http://java.sun.com/j2se/1.4.2/docs/api/java/lang/ThreadLocal.html

You would set it somewhere at the beginning of the request and then it
would be available as long as the thread stays alive.

Someone correct me if this is not a good idea or won't work

Hope it helps.
Corey

On 4/13/05, Mallik <[EMAIL PROTECTED]> wrote:
> I can use  getSesssion and setSession in the action class but I need to access
> session variable in my java bean where I perform my business logic, not in
> action class methods. (java beans are called from action class). I hope I am
> clear this time.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to