This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Struts and the fly likes Is ActionForm is part of controller or view Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Is ActionForm is part of controller or view" Watch "Is ActionForm is part of controller or view" New topic

Is ActionForm is part of controller or view

ram gaurav
Ranch Hand

Joined: Mar 29, 2006
Posts: 208
Is ActionForm is part of controller or view.??
vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
No Doubt ..............Its View
ram gaurav
Ranch Hand

Joined: Mar 29, 2006
Posts: 208
I also favour you but many places i have seen that they treat it as controller, so whats the exact thing.

They said it that as just view transfer data object.

So whats final...??
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
ActionForm is really part of the controller.

The View category contains utility classes � variety of custom tags making it easy to interact with the controller. It is not mandatory to use these utility classes.

Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
As far as I'm concerned, this is one of those "How many angels can fit on the head of a pin?" type philosophical questions.

The struts documentation discusses ActionForm classes in the "controller" section of the documentation, but they're very closely tied to the view as well. Which is it? We may never know!

Consultant, Sima Solutions
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Part of the controller? I have heard people claim that ActionForms were part of the model, but I don't see how they could fit into the Controller category. I consider them part of the View, but I see that they can bridge between layers.

I actually put a lot more code in my Forms that I think most people do. I treat them as a "View Helper" where I can throw methods that will reduce the amount of scriptlets that I need in the JSP. I also have "setData" and "getData" method in the form that handle the translation between the data objects returned by Toplink and the form fields. The form does not seem like a great place for this code, but it enables me to get a lot of reuse at the Action layer (the generic save action just needs to call the getData method on the form and pass the object returned along to the business tier).

- Brent
Raghavendra nandavar
Ranch Hand

Joined: Jun 26, 2005
Posts: 231
Its a part of view
Consider Paul's rocket mass heater.
subject: Is ActionForm is part of controller or view