wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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.
 
Consider Paul's rocket mass heater.
 
subject: Can session's data be accessed in ActionForms ?
 
Similar Threads
html:link tag ------- urgent
Strut-config
MapBacked ActionForms and DynaActionForm
ActionsForms and Value Objects
Value objects and ActionForms