• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is ActionForm is part of controller or view

 
ram gaurav
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is ActionForm is part of controller or view.??
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No Doubt ..............Its View
 
ram gaurav
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its a part of view
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic