• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ActionForm

 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the role of ActionForm in Struts?What does the below statement mean?
Struts reuses ActionForms instead of creating new ones for each request
 
Ranch Hand
Posts: 479
1
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Philippe,

Struts uses ActionForms to transfer the request parameters from the client to the execute() in the Action class on the server. It abstracts the usage of the HttpRequest.getParameter() which had to be used to retrieve each individual parameter till the Struts came along. The request parameters could then be processed as appropriate.

The reuse part means that Struts does not create new instances of the Form bean mapped to a particular form. If one is available it is used after calling the reset() method the nest time the same form is submitted.

Cheers,
Raj.
[ July 10, 2008: Message edited by: Raj Kamal ]
 
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Obviously the ActionForm is nothing but the carrier for the having the values set in the HTML form and which is what getting bound to the appropriate properties of the Form Bean you have. Instead of recreating new ActionForms, it is better reused!
 
After some pecan pie, you might want to cleanse your palatte with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic