You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Paull, Lori (DST-CLT)" <lo...@dstinteractive.com> on 2001/09/15 20:15:57 UTC

Accessing data in session scope form beans

I'm trying to figure out how I can access data that was entered into a
session-scoped form bean from an earlier screen within an action class.
Specifically, the value that I'm interested in was entered on a search
screen and saved with a variety of other criteria in a search ActionForm
class.  Some of these values are needed as parameters to database calls that
populate other screens.  How can I reference the search ActionForm within
each action class that needs access to those values?

Thanks!
--Lori

Re: Accessing data in session scope form beans

Posted by ma...@tumbleweed.com.
Assuming that the actions that need to access the search form bean know the
name of the bean, you can access it directly within the session:

ActionForm searchForm =
(ActionForm)session.getAttribute(searchFormBeanName);

--
Martin Cooper


----- Original Message -----
From: "Paull, Lori (DST-CLT)" <lo...@dstinteractive.com>
To: <st...@jakarta.apache.org>
Sent: Saturday, September 15, 2001 11:15 AM
Subject: Accessing data in session scope form beans


>
> I'm trying to figure out how I can access data that was entered into a
> session-scoped form bean from an earlier screen within an action class.
> Specifically, the value that I'm interested in was entered on a search
> screen and saved with a variety of other criteria in a search ActionForm
> class.  Some of these values are needed as parameters to database calls
> that populate other screens.  How can I reference the search ActionForm
> within each action class that needs access to those values?
>
> Thanks!
> --Lori
>
>