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)