Struts-implementation process

Source: Internet
Author: User

Simple process:

When publishing struts Web Services. initialize actionservlet and actioncontext in XML format. after receiving an httprequest request, actionservlet uploads the request parameters to the corresponding formbean Based on the configuration content in the struts-config.xml and sets the session (formbean is not used in development ). then, based on the action parameter in the request, find the specified action in the struts-config.xml and call this action to process the request. according to the processing result of the action, a forward variable is returned. findforward () finds the action or JSP page identified by the corresponding forward (not transferred to another action during development) and forwards the request to the next processing. if forward points to the JSP page, it is output to the foreground.

 

Example:

If you want to log on to a website built by STRUTS technology, you need to enter the user name and password, and then click log on. The process is as follows:

(1) The actionservlet receives the request sent by the user (the actionservlet has been initialized );

(2) After receiving the request, the actionservlet transmits the request parameters to the corresponding formbean according to the configuration content in the struts-config.xml.

(3) locate the specified action in the struts-config.xml based on the action parameter in the request and call this action to process the request

(4) According to the action processing result, a forward variable is returned. findforward () finds the action or JSP and forwards the request to the next processing. if forward points to the JSP page, it is output to the foreground.

 


 

Note: The action in struts is single-instance, so there is a thread security problem. For more information about the struts process, see actionservlet and requestprocessor.

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.