File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ActionForm

 
Kalyani Nayak
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic