File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Question concerning Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Question concerning "Action" classes (Chapter 3 of Struts 2 Design and Programming)" Watch "Question concerning "Action" classes (Chapter 3 of Struts 2 Design and Programming)" New topic
Author

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

Frederic Thierry
Greenhorn

Joined: Apr 16, 2006
Posts: 22
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

Joined: Apr 30, 2002
Posts: 65
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question concerning "Action" classes (Chapter 3 of Struts 2 Design and Programming)