Filter the implementation of the principles and order of execution

The implementation of the principle of

A map and a presence of the underlying array.
A map: Map of the value of the key, value for the Filter reference instance of an object.
An array: and there match the request Filter reference.
Execution: When a request for a resource to a web container, will first request parsing, parsing out using URI as a comparison to find whether there is a match the key from the Map. If there is, then read them value, that is a reference filter object, stored in the reference to the array, and then continue searching until the Map lookup is completed. This will exist in accordance with the search order sorted in the array filter reference.
After the array is initialized to begin execution in accordance with the order of elements in the array, the array of all filter after all is finished, jump to the target resource request.

Execution order

Find the order of the array can be seen when the execution order filter, and the sequence map is registered in accordance with the filter order. So when the same target resource request filter to register the first run.

Published 114 original articles · won praise 8 · views 5474

Guess you like

Origin blog.csdn.net/OVO_LQ_Start/article/details/104995445