The working mechanism of the action class in struts

Source: Internet
Author: User
Tags contains http request
The action class in struts   All action classes are org.apache.struts.action.Action subclasses. The action subclass should overwrite the Execute () method of the parent class. When the Actionform Bean is created and the form validation passes, the struts framework invokes the Execute () method of the action class. The Execute () method is defined as follows:    public Actionforward execute (actionmapping mapping                         Actionform form,                         HttpServletRequest request,                         HttpServletResponse response) throws IOException, servletexception;    Execute () method contains parameters:   Actionmapping: Contains the configuration information for this action, and corresponds to the      <action> element in the Struts-config.xml file.   Actionform: Contains the user's form data when the struts framework calls the Execute () method,     ActionfoThe data in RM has been validated by the form.   HttpServletRequest: The current HTTP request object.   HttpServletResponse: The current HTTP response object. The Execute () method of the   action class returns the Actionforward object, which contains the request forwarding path information.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.