DEVFYI - Developer Resource - FYI

What is an “Action Class”?

Struts Questions and Answers


(Continued from previous question...)

82. What is an “Action Class”?

The “Action Class” is part of the “Model” and is a wrapper around the business logic.
The purpose of the “Action Class” is to translate the HttpServletRequest to the business logic.
To use the “Action”, we need to subclass and overwrite the execute() method.
All the database and business processing is done in the “Action” class.
It is advisable to perform all the database related work in the “Action” class.
The ActionServlet (command) passes the parameterized class to ActionForm using the execute() method.
The return type of the execute method is ActionForward which is used by the Struts Framework to forward the request to the file according to the value of the returned ActionForward object.

(Continued on next question...)

Other Interview Questions