tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aggarwal, Ajay" <Ajay.Aggar...@stratus.com>
Subject filter order question
Date Thu, 04 Nov 2010 16:09:22 GMT
>From reading the doc, it seems the filters are invoked in the order in
which they appear in filter-mapping in web.xml. However I have a
situation where I have 2 filters one mapped using <servlet-name> and
other one mapped using <url-pattern> and they are not being invoked in
the right order.

 

Below is how my filter mappings look

      <!--  Filter Mappings -->

      <filter-mapping>

            <filter-name>F1</filter-name>

            <servlet-name>MyServlet</servlet-name>

      </filter-mapping>

      <filter-mapping>

            <filter-name>F2</filter-name>

            <url-pattern>/foo/*</url-pattern>

      </filter-mapping>

 

For my request, they both match and I would have expected the order as
F1 --> F2. However they are being invoked in order F2 --> F1.

 

What am I doing wrong?

 

-Ajay

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message