aspose file tools*
The moose likes Struts and the fly likes Can session's data be accessed in ActionForms ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Can session Watch "Can session New topic
Author

Can session's data be accessed in ActionForms ?

Anand Gondhiya
Ranch Hand

Joined: Feb 24, 2004
Posts: 155
Hi,

I use sruts 1.1. is there anyway you can access session variables in the ActionForms ?
thanks
-Anand.
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Depends what you're talking about: validate gets passed a HttpServletRequest, so request.getSession() would obviously give you access to the HTTPSession.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

The reset method also has request. It is possible to have a local variable on the ActionForm to hold request or session which would get set in the reset method. That said, I reeeeeeally don't recommend it.


A good workman is known by his tools.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can session's data be accessed in ActionForms ?