What is Action Class. What are the methods in Action class

Showing Answers 1 - 5 of 5 Answers

KS

  • May 3rd, 2005
 

Action class is request handler in Struts. we will extend the Action class and over ride the execute() method in which we will specify the business logic to be performed.

  Was this answer useful?  Yes

Sumit Bansal.

  • May 3rd, 2005
 

An Action is an adapter between the contents of an incoming HTTP request and the corresponding business logic that should be executed to process this request. The controller (RequestProcessor) will select an appropriate Action for each request, create an instance (if necessary), and call the execute method. 
 
Actions must be programmed in a thread-safe manner, because the controller will share the same instance for multiple simultaneous requests. This means you should design with the following items in mind:  
 
Instance and static variables MUST NOT be used to store information related to the state of a particular request. They MAY be used to share global resources across requests for the same action.  
Access to other resources (JavaBeans, session variables, etc.) MUST be synchronized if those resources require protection. (Generally, however, resource classes should be designed to provide their own protection where necessary.  
When an Action instance is first created, the controller will call setServlet with a non-null argument to identify the servlet instance to which this Action is attached. When the servlet is to be shut down (or restarted), the setServlet method will be called with a null argument, which can be used to clean up any allocated resources in use by this Action. 
 

  Was this answer useful?  Yes

pratap

  • Jul 11th, 2005
 

plz provide answers for j2ee part. for the following divisions 
jsp 
servlets 
struts 
ejb

  Was this answer useful?  Yes

Action class in which define which action has to be taken for this all forword condition create there.Action class have a Execute() method.

  Was this answer useful?  Yes

Guest

  • Feb 24th, 2007
 

Action class is request handler in Struts. we will extend the Action class and over ride the execute() method in which we will specify the business logic to be performed.

  Was this answer useful?  Yes

ganeshh

  • Mar 31st, 2007
 

An Action class is some thing like an adapter between the contents of an incoming HTTP request and the corresponding business logic that should be executed to process this request.The methods in action class are execute() generateToken() resetToken() getServlet().

  Was this answer useful?  Yes

sujana

  • Apr 30th, 2007
 

previously we used perform() in action class ,now in struts 1.1 we are using execute() .action class is request handler invoked by Action servlet ,when user send  a request from browser using the extension .do then Actionservlet is invoked ,it will check for the mappings in struts-config.xml then it will execute Actionservlet ,it will invoke the method on action class i.e execute() evaluated .

  Was this answer useful?  Yes

venkat

  • Jun 13th, 2007
 

Methods in Action class are execute(), reset() and validate().

  Was this answer useful?  Yes

sailuk

  • Oct 26th, 2007
 

An Action class in the struts application extends Strutsorg.apache.struts.action.Action" Class. Action class acts as wrapper around the business logic and provides an inteface to the application's Model layer. It acts as glue between the View and Model layer. It also transfers the data from the view layer to the specific business process layer and finally returns the procssed data from business layer to the view layer.

koseavase

  • Jan 23rd, 2008
 

Action is not a request handler rather its a request processor (ActionServlet is a request handler)

It has the execute method where the request gets processed.

Inside execute method core business logic is not written instead business objects are called and manipulated

  Was this answer useful?  Yes

Action Class is a controller in Struts. Struts following the MVC2 architecture, like...
Model ---> ActionForm (FormBean)
Controller ---> ActionServlet and Action Class
View ---> JSP

Action Class contains execute() method. The return type of this method is ActionForward.

In struts1.0, the execute() is defined as perform(). In struts1.1 perform() is replaced by execute().

ActionForm contains reset() and validate() methods.

reset() ---> used for providing default values.
validate() ---> Used for check all the validations are satisfied or not.

  Was this answer useful?  Yes

This is the class from which business logic of stuts
begins,which contains execute method ..This class contains all
deployment information of particualar Action object.
This class determines where the result must send once its
 processing is complete as a ActionForward Object.

  Was this answer useful?  Yes

devabscmca

  • Jul 31st, 2010
 

Action Class acts as a controller b/n user data and business logic.It is having execte() method using this we are calling business logic.

Execute method syntax :-

public ActionForward execute(ActionMapping am,ActionForm fm,HttpservletRequest rq,HttpServletResponse rs) ServleException,IOException
{  }

Action  Class is the last component in controller layer.
                       

  Was this answer useful?  Yes

E Ravinder

  • Dec 27th, 2017
 

Action

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions