• 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

Question concerning "Action" classes (Chapter 3 of Struts 2 Design and Programming)

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Budi,

I recently was able to browse through your first few chapters available on the brainy software website and I was wondering whether you could answer the following question:

I had a look at your 3rd chapter and you described Action classes as being the model classes in Struts2(Hence this class will contain the business logic). But recently I came accross a website that described Actions rather as Controllers. So I am now confused. Could you please tell me whether Action classes act as the "Model" or the "Controller".

What about when I use Struts 2 with a Spring Business Facade, do Actions then change role from "Model" to "Controller"?

Thank you very much in advance for claryfiyng this topic for me.

Thanks,

Fred
 
Author
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've heard people describing the action as part of the Controller. My guess is they view the action as a place where models are instantiated and business methods/delegates called. In this case, it is not inaccurate to regard the action as an extension of the controller.

On the other hand, in Struts 2 an action is often a POJO with properties that get assigned values and have methods that do more than validation. In this case, clearly it is a model.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic