concept 2 action in category java

appears as: 2 actions, 2 action
Struts 2 in Action

This is an excerpt from Manning's book Struts 2 in Action.

In this chapter, we learned a lot about building Struts 2 actions. We began our tour of this important component by examining the role of actions within the framework. Actions have to do three things. First and foremost, they encapsulate the framework’s interaction with the model. This means, ultimately, that the calls to the business logic and data tier will be found in the execute() method of the action class. The second job of the action is to serve as the data transfer object for the request processing. We suspect we’ve made this point particularly clear by now. Finally, the action also takes responsibility for returning a control string that’ll be used by the framework to select the appropriate result component for rendering the view back to the user.

Listing 14.9. Struts 2 action with model bean