Apache Struts 2 Documentation Big picture

Source: Internet
Author: User

Http://struts.apache.org/docs/big-picture.html

1. HttpServletRequest through each filter to reach Filterdispatcher (this is no longer used, now use Strutsprepareandexecutefilter)

2. Execute the Dofilter method, if the pattern does not match, then go to the next filter chain

3. Create context if match (create instance for each request, thread safe)

4. Determine if the action should be invoked according to Actionmapping

5. Delegate control to Actionproxy if you need to invoke the action

  Public voidDoFilter (servletrequest req, servletresponse Res, filterchain chain)throwsIOException, servletexception {httpservletrequest request=(httpservletrequest) req; HttpServletResponse Response=(HttpServletResponse) res; Try {            if(Excludedpatterns! =NULL&&prepare.isurlexcluded (Request, Excludedpatterns))            {Chain.dofilter (request, response); } Else{Prepare.setencodingandlocale (request, response);                Prepare.createactioncontext (request, response);                Prepare.assigndispatchertothread (); Request=prepare.wraprequest (Request); Actionmapping Mapping= prepare.findactionmapping (Request, Response,true); if(Mapping = =NULL) {                    Booleanhandled =execute.executestaticresourcerequest (request, response); if(!handled)                    {Chain.dofilter (request, response); }                } Else{execute.executeaction (request, response, mapping); }            }        } finally{prepare.cleanuprequest (request); }    }
View Code

6. Querying the configuration file

7. Create the actioninvocation, which has the following relationship to the Interceptor:

/**      * Override to handle interception     */public    abstract  Throws Exception;

8. Call the interceptor stack, action class

9. Action returns the result, it is possible to render a template such as JSP, which will initiate additional requests

10. Call Interceptor Stack after rendering

HttpServletResponse through the filter.

The client gets a response

Apache Struts 2 Documentation Big picture

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.