• 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

action class in struts 1.2

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


Is Action class is part of controller or model?i am confused


Thanks in advance
 
Ranch Hand
Posts: 199
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

In my way to see the world I would say that an action is part of the controller,
a form is part of the view model and a dao is part of the data model.


Best regards,,
 
Carles Gasques
Ranch Hand
Posts: 199
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Carles Gasques wrote:Hi,

In my way to see the world I would say that an action is part of the controller (because links presentation with business logic),
a form is part of the view model and a dao is part of the data model.


Best regards,,

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Action class is a part of Controller.

The first thing that makes me confirm this is, "Struts handle with Controller and Views only, but not with Models(EJBs/COBRA/whatever should handle model) in Struts MVC framework".

It tries to do the communication before business logic, and ActionForm is a view data Transfer Object - that merely transfers the data to various classes within the controller.
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Action class can act as a model and also helper class for controller servlet called ActionServlet in struts

MVC rule Controller(ActionServlet) should interact with model

1.Action class as a Model
In small scale applications,It is good to write Business Logic in Action class.ActionServlet interacts with Action class.

2.Action Class as a helper Class for Contoller Servlet(ActionServlet)(part of controller)

In Large scale applications where Spring or EJB componets are acting as a model,There Cortoller Servelet(ActionServlet) can not interact with Spring or EJB components because its a Built_in class ,so we write the logic to interact with Spring or EJB in Action class.That means ActionSevlet interaction with the Model with the help of Action class.

Thanks
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Priyanka,

Action class acts as both Controller and Model depends on the application.

I agree with suresh explanation.
 
asr chowdary
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thanks Vineela..
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic