To Develop your owte the following steps. That Steps Describe the minimum Actions That You Must Take WhenImum A New Action and Are The Focus of this section Section:
1.create a class there.
2. IMPLEMENT The Appropriate Execute () Method and add your specific business logic.
3.Compile The New Action and Move It Into The Web Application's ClassPath. This Would Most Offense.
4.Add an
Implementing the execute () Method:
The Execute () Method Has Two Functions:
Component Description ActionMapping Contains all of the deployment information for a particular Action bean. This class is to determine where the results of the LoginAction will be sent once its processing is complete. ActionForm Represents the Form inputs containing the request parameters from the View referencing this Action bean. The reference being passed to our LoginAction points to an instance of our LoginForm. HttpServletRequest A reference to the current HTTP request object. HttpServletResponse A reference to the current HTTP response object.
As You Build your OWN Action Objects, you will notice That The Almost All Perform The Same Sequence of Events.
1.cast The Actionform Reference Associated With Action To Your Specific Actionform Implementation. In The Previous The Passed-in Actionform Object To a SkeletonForm.
2.Add your specific business logic.
3.Use the ActionMapping.findForward () method to find the ActionForward object that matches the
Configuring the means Class:
Attribute Description attribute Names a request or session scope attribute that is used to access an Action-Form bean, if it is other than the bean's specified "name". ClassName Names the fully qualified class name of the ActionMapping implementation class you want to use in when invoking this Action class. If the className attribute is not included, the ActionMapping defined in the ActionServlet's mapping initialization parameter is used. forward Represents a Module-relative path of the servlet or JSP resource that will process this request. This attribute is used if you do not want an Action to service the request to this path. The forward attribute is valid only if no include or type attribute is specified. include Represents a Module-relative path of the servlet or JSP resource that will process this request. This attribute IS Used if you do not want an action to service the request to this path. The include attribute is valid only if no forward or type attribute isbook ified. input Represents a Module-relative path of the input form to which control should be returned if a validation error is encountered. The input attribute is where control will be returned if ActionErrors are returned from the ActionForm or Action objects. (Optional) name Identifies the name of the form bean that is coupled with the Action being defined. path Represents the Module-relative path of the submitted request. The path must be unique and start with a / character. parameter A generic configuration parameter that is used to pass Extra information to the action Object defined by this action mapping. Roles a comma-delimited list of security roles That Can Access the defined
object. type Names the fully qualified class name of the Action class being described by this ActionMapping. The type attribute is valid only if no include or forward attribute is specified. scope Names the scope of the form bean that is bound to the described Action. The possible values are request or session. The default value is session. unknown If set to true, this
Type = "ch04.lookupaction" Name = "lookupform" INPUT = "/ index.jsp"> action> action-mappings> IT Performs The User-Defined Business Logic Associated With your application. It Tells The framework where it would next route the request. The parameters of the action.execute () Method: