• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding ActionForm in Struts

 
Jay Shukla
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I'm new to Struts Framwork.

I have read regarding ActionForm that

"An intersting thing (about ActionForm) is that you can declare the same ActionForm class any number of times provided each entry has a unique name associated with it"


I do not know how can it be possible that you are using same Action Form more than once and with unique name. Can anyone please explain me with example (if possible) how could above statement be true.

Thanks in Advance.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's as simple as it sounds; when you declare an action form you're associating a class with a name. You can use the same class as much as you want, because it's instantiated under the given name. That's how we can use any number of dyna forms: each dyna form is the same class, but under a different name.
 
Jay Shukla
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David Thanks for your reply.

You have mentioned that


when you declare an action form you're associating a class with a name


By your above statement your mean to say that in struts-config.xml, what we are decalring <form-beans> tags.

And i think we are declaring dynaforms in struts-config.xml , am i right about this?

Thanks.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic