Share on Google+Share on Google+

Action in Struts 2 Framework

Advertisement
Actions are the core basic unit of work in Struts 2 framework. Each action provides the processing logic for a specific URL with which it is linked. Actions are mostly associated with a HTTP request of User.

Actions

Actions are the core basic unit of work in Struts2 framework. Each action provides the processing logic for a specific URL with which it is linked. Actions are mostly associated with a HTTP request of User.

The action class contains business logic, retrieve resource bundle, hold the data, validation, and select the view result page that should send back to the user

action class transfer data from request to the View. It also determines which result should render the view.

class MyAction
{
public void String execute() throws Exception { return "success"; }
}

action class does not extend another class and nor it implements any interfaces.

"execute" method returns a String result code, which actions configuration matches with a specific result that will be rendered to the user.

Advertisements

Posted on: September 21, 2013 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Comments:0