Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:jetty 6.0.0beta17
-
Number of attachments :
Description
For a configuration like the following in web.xml :
<filter>
<filter-name>myFirstFilter</filter-name>
<filter-class>com.acme.MyFirstFilter</filter-class>
</filter>
<filter>
<filter-name>mySecondFilter</filter-name>
<filter-class>com.acme.MySecondFilter</filter-class>
</filter>
the init methods are called in this order :
- MySecondFilter.init( FilterConfig filterConfig )
- MyFirstFilter.init( FilterConfig filterConfig )
instead of :
- MyFirstFilter.init( FilterConfig filterConfig )
- MySecondFilter.init( FilterConfig filterConfig )
The servlet specification does not define an order for filters to be initialised.
The only requirement is that the init method be called before the doFilter method is called.
Jetty currently initialises filters in the reverse order to which they are declared.
This behaviour may not be desired (and I'm not sure it really makes much sense), but it is not "wrong" according to the spec.
Any application that relies on the order of filter initialisation is not portable between containers.