69. What is struts actions and action mappings.

A Struts action is an instance of a subclass of an Action class, which implements a portion of a Web application and whose perform or execute method returns a forward.

An action can perform tasks such as validating a user name and password.

An action mapping is a configuration file entry that, in general, associates an action name with an action. An action mapping can contain a reference to a form bean that the action can use, and can additionally define a list of local forwards that is visible only to this action.

An action servlet is a servlet that is started by the servlet container of a Web server to process a request that invokes an action. The servlet receives a forward from the action and asks the servlet container to pass the request to the forward’s URL.

An action servlet must be an instance of an org.apache.struts.action.ActionServlet class or of a subclass of that class. An action servlet is the primary component of the controller.

Advertisements

3 Responses

  1. action-mapping tag in the struts-config.xml have the following attributes
    1.path: URL used to access the struts application
    2.type: Specifies the Action class that should be executed when the path is requested.
    3.name: this attribute coresponds to the name of the form bean defined the struts-confing.xml
    4.scope: Sets the scope of the form bean
    5.validate: (true/false) will specify whether to execute the validate() method or not
    6.input: what page is used to input the data

  2. Action Class acts as the bridge between the View and Model layers and is responsible for processing the request. Action Class are intended to transfer the data from the view layer to specific business process in the model layer and then return the data from the business process to view layer.When the request with the specified path is made to ActionServlet, the action(action tag in struts-config.xml) is invoked to process the request.When this action is called to process the request, its execute() method is invoked.

  3. […] or of a subclass of that class. An action servlet is the primary component of the controller. 2 comments September 9th, […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: