| Author |
ActionForm
|
Kalyani Nayak
Greenhorn
Joined: Jan 01, 2006
Posts: 25
|
|
I am studing struts. While reading from one of the site, link below http://www.adventnet.com/products/webnms/help/developer_guide/web_client/web_struts_config.html I am little bit confused with the point, in the explaination for the 'Form-beans' as follows- <pre>name: Must have a unique bean name. This name is used as reference in the action mappings. <b>Often, this is also the name of the request or the session attribute under which the form is stored.</b> </pre> But in case if I want to set two different references of the form beans in the request and session scope then what will the aproach. e.g. one of the property of form bean, I want to skip from the session scope reference.
|
 |
Frank Bueckert
Greenhorn
Joined: Mar 23, 2006
Posts: 8
|
|
form beans can be either request or session scope. In your controller class, do your calculations, and then put for request objects or for session objects. Then, in your JSP, you put Just make sure you have scope set to the instance you want, and you'll have access to it. Just point all struts name parameters at the bean:define id parm, and you can yank whatever you want out of it. There's probably an easier way to do this, but that's how I do it. [ March 24, 2006: Message edited by: Frank Bueckert ]
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
|
Trying to keep a copy of the ActionForm bean in both the request and the session at the same time would be a very bad idea. Struts would read one or the other (I'm not really sure which) but not both. I'm not sure what you're trying to accomplish by doing this, but I suggest finding another way to accomplish the same thing.
|
Merrill
Consultant, Sima Solutions
|
 |
 |
|
|
subject: ActionForm
|
|
|