Java-understanding of Struts Framework

Source: Internet
Author: User
The actionservlet of struts controls the navigation flow. Other struts classes, such as action, are used to access the business logic class. When the actionservlet receives a request from the container, it uses uri (or path "path") to determine which action will be used to process the request. An action can verify the input and access the business layer to retrieve information from the database or other data services.

To verify the input or use the input to update the database, the action needs to know the value to be submitted. It does not force each action to capture these values from the request. Instead, the actionservlet binds the input to the JavaBean.

The input Bean is a subclass of the struts actionform class. By searching the Request Path, actionservlet can decide which actionform to use. Action is also selected in the same way. Actionform extends the org. Apache. Struts. Action. actionform class. Each request must be responded with an HTTP response. Generally, Struts actions do not render the response information themselves, but forward requests to other resources, such as JSP pages. Struts provides an actionforward class to save the path of a page as a logical name. After the business logic is completed, the action selects and returns
Actionforward. Servlet then uses the path saved in the actionforward object to call the page to complete the response.

Struts binds these details to an actionmapping object. Each actionmapping is relative to a specific path. When a path is requested, the servlet queries the actionmapping object. The actionmapping object tells the servlet which actions, actionform, and actionforward will be used by this request.

all these details, about action, actionform, actionforward, actionmapping, and something else, are defined in the struts-config.xml file. At startup, actionservlet reads the configuration file and creates a configuration object database. During runtime, the struts application creates a configuration object based on the file, instead of the file itself.

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.