Action Classes as Controller Components in Struts Framework

Action Classes as Controller Components in Struts Framework

Previous Home Next

 

In struts framework, Action class work as a controller components because This class handle incoming request and add all business logic that should be executed to process. After the execution of the process, return the retrieved ActionForward object.

 This class control application’s specific logic.The org.apache.struts. action.Action class must be extended for each specialized struts function in your application.

If You want to develop own Action class ,You must complete the following step :-

1.
 Create a action class that class extends the Action class.
2. In this step,implements the execute() methods . This method have business logic .
3. Final step, add action element to the application's struts-config.xml file.

Signature of execute() method :-

public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) 
throwss IOException,ServletException;

This method return the appropriate ActionForward object.


Previous Home Next