Chris,

Thanks for the reply.

I upgraded to tomcat 6.0.16 and peeked at the source.
It appears that the filter elements are being returned from the web.xml in the 
order they were defined.
They are then placed into a HashMap (which of course has no reliable ordering).
That is where mis-ordering happens.

So I think in the short term I may patch it real quick to provide a 
LinkedHashMap for the filterDef.
Then long term I think we're gonna look to find something else to do 
initializations. Thinking that perhaps
a listener (since they, according to the tomcat code, are started before the 
filters) would be a good place to do most
of the the inits and remove any order-dependencies in the individual filters.

Thanks to all for the replies, I think we can consider the issue resolved.

-ken

-----Original Message-----
From: Christopher Schultz [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 13, 2008 12:26 PM
To: Tomcat Users List
Subject: Re: Filter Init order


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ken,

[EMAIL PROTECTED] wrote:

> However, I can even remove the mapping and just leave the filter declaration 
> and the inits still happen.

The servlet specification doesn't say anything about the ordering of
init calls to filters... only that they are guaranteed to be called
before a request that needs that filter is processed.

This leaves it up to the container implementors to decide what order to
use. Top-down in the deployment descriptor (web.xml) would be a
reasonable expectation, but it is by no means the standard.

If you have filters that depend on each other, you might want to
implement a lazy initialization strategy that actually delays
initialization until after init() has been called on each of the filters.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkcYyQACgkQ9CaO5/Lv0PBVegCfRw0PCZHjAzFbPfWyHdZyn5Vz
XSIAn2exuvviBPbZxWOap7M9U+Ihso/d
=x/k3
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-----------------------------------------
This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law.  If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED.  Although this transmission and
any attachments are believed to be free of any virus or other
defect that might affect any computer system into which it is
received and opened, it is the responsibility of the recipient to
ensure that it is virus free and no responsibility is accepted by
JPMorgan Chase & Co., its subsidiaries and affiliates, as
applicable, for any loss or damage arising in any way from its use.
 If you received this transmission in error, please immediately
contact the sender and destroy the material in its entirety,
whether in electronic or hard copy format. Thank you.

Reply via email to