• 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 vs ActionFormBean

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone explain the difference between the ActionForm and ActionFormBean classes?
I am under the impression that ActionForm the class that a developer will extend to create a "form bean" (java bean). The ActionServlet (controller) transfers form data from a HttpServletRequest object to a "form bean" object. The "form bean" object is then passed to the corrosponding Action object for further processing (defined by the developer). I thought I had this correct until I saw that the Struts API and a class called ActionFormBean!
What am I missing?
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am still using Struts 1.0.2 since 1.1 is just beta and we don't want to move to 1.1 until it is production-ready. We will then use the Validator that is bundled with 1.1. For now, though, we use the ActionForm classes that you mention in part to do what you mention. I believe that ActionFormBean is a class used internally by Struts and is not something you have to extend or otherwise concern yourself with. If you extend the ActionForm classes as you describe, thinks should work as you describe.
An interesting resource in seeing the different parts of Struts is at http://rollerjm.free.fr/pro/Struts.html and it talks a little about ActionForm and ActionFormBean. The names are confusing.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for giving a link to my article, Dustin ! I am the author of the article Struts Controller UML diagrams.
To use Struts, you don't need to know in detail what is the ActionFormBean. As it is open-source software, you can download the code and study it if you want to understand how the Controller works (it is very good quality code !).
 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jean-Michel,
JavaRanch has a naming policy which is strictly enforced. Please read the policy and change your display name if you wish to continue posting here.
You can change your name:
here
 
reply
    Bookmark Topic Watch Topic
  • New Topic