[Opensource] Accessing HttpSession

Michael Rimov rimovm at centercomp.com
Sat Feb 22 20:20:27 PST 2003


At 04:16 AM 2/22/2003 -0800, you wrote:
>I am trying to use the tree structure in tomcats leftnav in my Expresso 
>project. As it is written in struts framework it has used the HttpSession 
>instead of persistentSession. How can I access the HttpSession in my 
>controller's states.

Well, you can cast the 'ControllerRequest' to 'ServletControllerRequest', 
just be forewarned that it blocks you from using the Controller in anything 
but a web servlet environment.

For the record, you easily get the session in your controller by calling:

         request.getSession()

And then save objects to the session by:
         request.setPersistentAttribute()

HTH!
                                                 -Mike







More information about the Opensource mailing list