File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Frederic Thierry
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Budi Kurniawan
Author
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic