0

I am new to Struts 1 and I am trying to educate myself via the official documentation provided by apache.org website.

The difference between ActionForm Beans and ActionsForm Classes is not completely clear to me. I do understand the standards for creating a java bean. But I am a bit puzzled by the fact that the "ActionForm Classes" section lists principles to create "ActionForm Bean".

Why are these listed as two separate items? Shouldn't all Struts ActionForms be created as java beans? Could anyone please enlighten me with an explanation or some examples? Thank you!

Here is the information source:

2.3 ActionForm Beans

Note: While ActionForm beans often have properties that correspond to properties in your Model beans, the form beans themselves should be considered a Controller component. As such, they are able to transfer data between the Model and View layers.

source: http://struts.apache.org/development/1.x/userGuide/building_model.html

4.3 ActionForm Classes

An ActionForm represents an HTML form that the user interacts with over one or more pages. You will provide properties to hold the state of the form with getters and setters to access them. ActionForms can be stored in either the session (default) or request scope. If they're in the session it's important to implement the form's reset method to initialize the form before each use. The framework sets the ActionForm's properties from the request parameters and sends the validated form to the appropriate Action's execute method.

When you code your ActionForm beans, keep the following principles in mind: . . .

source: http://struts.apache.org/development/1.x/userGuide/building_controller.html

BustedSanta
  • 1,368
  • 7
  • 28
  • 55
  • I don't really understand your confusion, for all intents and purposes the terms mean the same thing in this case. Too bad you're just now starting with an EOLed technology though. – Dave Newton Sep 04 '14 at 21:15
  • @DaveNewton - I realize Struts1 is "old" but that's what the application utilizes so I don't have a choice but familiarize myself with Struts1. My confusion comes from the fact that ActionForm Beans is (in the official documentation) under the "building model" section and ActionForm Classes is under the "building controller" section. But as far as I can understand ActionForm Beans and ActionForm Classes do appear to be the same thing. IF the Beans and Classes perform the same function why list one as a model and the other as a controller? – BustedSanta Sep 05 '14 at 00:17
  • 1
    Probably because the documentation is over a decade old and nobody did anything about it. – Dave Newton Sep 05 '14 at 09:25

0 Answers0