The servlet and filter running relationship of actual combat-javawweb (iv)

Source: Internet
Author: User

Understand the operational relationship between servlet and filter by explaining and summarizing three practical articles.


The servlet and filter running relationship in combat-javawweb (i)

Operation relationship between servlet and filter in combat-javawweb (II.)

Operation relationship between servlet and filter in combat-javawweb (iii)


The following is a running diagram of the servlet and filter that illustrates the order in which the servlet and filter are executed, response the composition of the object output, and so on.


650) this.width=650; "style=" width:700px;height:405px; "src=" http://s3.51cto.com/wyfs02/M01/4D/9A/ Wkiom1rulxmrrzrvaag6hsrbuom771.jpg "title=" 3-copy. png "height=" 405 "hspace=" 0 "vspace=" 0 "width=" "" border= "0" alt= " Wkiom1rulxmrrzrvaag6hsrbuom771.jpg "/>



Figure D-1

1.Filter Chain Execution Order

Filter1->filter2->...->filter (n-1)->filter (n)->servlet->filter (n)->filter (n-1)->...- >filter2->filter1.

2. Output Content composition

Call Dofilter before + Servlet + call Dofilter


The above 1 and 2 illustrate the execution of the servlet and the filter, and one request will be accompanied by a filter or multiple, and the final result naturally depends on the combination of actual filter and servlet execution.


This article from "Mustang Red" blog, declined reprint!

The servlet and filter running relationship of actual combat-javawweb (iv)

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.