You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Stevo Slavić <ss...@gmail.com> on 2011/02/08 10:31:28 UTC
Servlet 3.0, @WebFilter and ordering
Hello Tomcat users,
Now that Tomcat 7 is out with Servlet 3.0 support, I've been trying
out new features it brings. In pre 3.0 servlet era, one would specify
filter in web.xml and order they are defined in the xml would
determine order filters would get applied. I don't see support for
ordering in @WebFilter annotation. Am I missing something?
I know one can now programatically register filters - not sure yet but
I guess order filters are programatically registered determines order
they will be applied. But if this is the only way to control ordering,
@WebFilter is (almost) useless, without support of additional
framework.
Not sure if this mailing list is correct destination for this kind of
question. I apologize, if it isn't.
Regards,
Stevo.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Servlet 3.0, @WebFilter and ordering
Posted by Mark Thomas <ma...@apache.org>.
On 08/02/2011 09:31, Stevo Slavić wrote:
> Hello Tomcat users,
>
> Now that Tomcat 7 is out with Servlet 3.0 support, I've been trying
> out new features it brings. In pre 3.0 servlet era, one would specify
> filter in web.xml and order they are defined in the xml would
> determine order filters would get applied. I don't see support for
> ordering in @WebFilter annotation. Am I missing something?
No. You are not missing anything.
> I know one can now programatically register filters - not sure yet but
> I guess order filters are programatically registered determines order
> they will be applied. But if this is the only way to control ordering,
> @WebFilter is (almost) useless, without support of additional
> framework.
>
> Not sure if this mailing list is correct destination for this kind of
> question. I apologize, if it isn't.
It is the right place to ask these sorts of questions but getting it
changed means contacting the Servlet EG.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Servlet 3.0, @WebFilter and ordering
Posted by Stevo Slavić <ss...@gmail.com>.
Thanks everyone,
Just wish there was an "Ordered" interface, or annotation, or
attribute of @WebXXX annotations to which ordering can be applied, so
that web.xml is not needed for such IMO basic feature.
Regards,
Stevo.
On Wed, Feb 9, 2011 at 8:58 AM, Remy Maucherat <re...@gmail.com> wrote:
> On Wed, Feb 9, 2011 at 7:46 AM, Konstantin Kolinko
> <kn...@gmail.com> wrote:
>> 2011/2/8 Christopher Schultz <ch...@christopherschultz.net>:
>>> On 2/8/2011 4:31 AM, Stevo Slavić wrote:
>>>> I don't see support for
>>>> ordering in @WebFilter annotation. Am I missing something?
>>>
>>> I don't see anything that would allow an ordering to be specified.
>>>
>>
>> Ordering is discussed in chapters 8.2.2 and 8.2.3 of the servlet 3.0 spec.
>>
>> In 8.2.3 it is explicitly written:
>> "As described above, when using annotations to define the listeners,
>> servlets and filters, the order in which they are invoked is
>> unspecified"
>
> Well, but it is still defined a bit by the ordering of the JARs. But
> within the JAR, the order of processing of @WebFilter is undefined,
> which seems quite logical to me.
> (If you need ordering, use a SCI or listener and add the filters
> programmatically)
>
> Rémy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Servlet 3.0, @WebFilter and ordering
Posted by Remy Maucherat <re...@gmail.com>.
On Wed, Feb 9, 2011 at 7:46 AM, Konstantin Kolinko
<kn...@gmail.com> wrote:
> 2011/2/8 Christopher Schultz <ch...@christopherschultz.net>:
>> On 2/8/2011 4:31 AM, Stevo Slavić wrote:
>>> I don't see support for
>>> ordering in @WebFilter annotation. Am I missing something?
>>
>> I don't see anything that would allow an ordering to be specified.
>>
>
> Ordering is discussed in chapters 8.2.2 and 8.2.3 of the servlet 3.0 spec.
>
> In 8.2.3 it is explicitly written:
> "As described above, when using annotations to define the listeners,
> servlets and filters, the order in which they are invoked is
> unspecified"
Well, but it is still defined a bit by the ordering of the JARs. But
within the JAR, the order of processing of @WebFilter is undefined,
which seems quite logical to me.
(If you need ordering, use a SCI or listener and add the filters
programmatically)
Rémy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Servlet 3.0, @WebFilter and ordering
Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/2/8 Christopher Schultz <ch...@christopherschultz.net>:
> On 2/8/2011 4:31 AM, Stevo Slavić wrote:
>> I don't see support for
>> ordering in @WebFilter annotation. Am I missing something?
>
> I don't see anything that would allow an ordering to be specified.
>
Ordering is discussed in chapters 8.2.2 and 8.2.3 of the servlet 3.0 spec.
In 8.2.3 it is explicitly written:
"As described above, when using annotations to define the listeners,
servlets and filters, the order in which they are invoked is
unspecified"
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Servlet 3.0, @WebFilter and ordering
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Stevo,
On 2/8/2011 4:31 AM, Stevo Slavić wrote:
> I don't see support for
> ordering in @WebFilter annotation. Am I missing something?
I don't see anything that would allow an ordering to be specified.
> But if [programmatically adding] is the only way to control ordering,
> @WebFilter is (almost) useless, without support of additional
> framework.
I agree.
I think the best thing to do is always use declarative configuration
through the use of web.xml, but then again, I detest annotations. :)
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk1RrRgACgkQ9CaO5/Lv0PCJRgCeJpnmsqKibh3tlb4FLD9n3wHH
5YkAn0Vk5hgxLHYQBHDgsTKf0WQ1PjZL
=+0JO
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org