Here filter F1 is mapped to servlets S1, S2, and S3, filter F2 is mapped to servlet S2, and filter F3 is mapped to servlets S1 and S2.
I found this in Sun Filter Tutotial
Can anyone clarify this through code or diagram for better understanding?
Thanks in advance !
See section 6.2.4 in the servlet spec for the rules used in determining the chaining order.
Here is an excerpt:
The order the container uses in building the chain of filters to be applied for a
particular request URI is as follows:
1. First, the <url-pattern> matching filter mappings in the same order that these
elements appear in the deployment descriptor.
2. Next, the <servlet-name> matching filter mappings in the same order that
these elements appear in the deployment descriptor.
If a filter mapping contains both <servlet-name> and <url-pattern>, the
container must expand the filter mapping into multiple filter mappings (one for
each <servlet-name> and <url-pattern>), preserving the order of the <servletname>
and <url-pattern> elements. For example, the following filter mapping:
I've attached an image produced by JDeveloper to help visualize the structure...