Re: what is the exact order of filters?

2021-01-18 Thread Johan Compagner
> You need to read section 8.2.3 of the servlet specificaiton
>
> 
> If the order in which the listeners, servlets, filters are invoked is
> important to an application then a deployment descriptor must be used.
> Also, if necessary, the ordering element defined above can be used. As
> described above, when using annotations to define the listeners,
> servlets and filters, the order in which they are invoked is unspecified.
> 
>
> Entries in the global web.xml files will be added after those from the
> application web.xml
>
>
yes thats what i was testing also
But where are then annotations coming in?
I can't find that.
And i mean together with a web.xml in conf and a web.xml in web-inf where
there are also definitions of filters and mappings..

It seems to me that it is:

WEB-INF/web.xml (these do have order between them)
annotations (unordered)
conf/web.xml (these do have order between them)

or is that just an tomcat implementation? that other containers don't
really have to follow?


Re: what is the exact order of filters?

2021-01-17 Thread Mark Thomas
On 15/01/2021 16:00, Johan Compagner wrote:
> Hi
> here we have a case: 51754 – Tomcat7 filters from conf/web.xml are applied
> after filters defined in WEB-INF/web.xml (apache.org)
> 
> 
> that already says that the conf/web.xml are later then WEB-INF/web.xml
> 
> is it so that the order is something like
> 
> 
> WEB-INF/web.xml
> annotations based once
> conf/web.xml
> 
> ?
> 
> I am also not sure what the spec says about this mix

You need to read section 8.2.3 of the servlet specificaiton


If the order in which the listeners, servlets, filters are invoked is
important to an application then a deployment descriptor must be used.
Also, if necessary, the ordering element defined above can be used. As
described above, when using annotations to define the listeners,
servlets and filters, the order in which they are invoked is unspecified.


Entries in the global web.xml files will be added after those from the
application web.xml

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



what is the exact order of filters?

2021-01-15 Thread Johan Compagner
Hi
here we have a case: 51754 – Tomcat7 filters from conf/web.xml are applied
after filters defined in WEB-INF/web.xml (apache.org)


that already says that the conf/web.xml are later then WEB-INF/web.xml

is it so that the order is something like


WEB-INF/web.xml
annotations based once
conf/web.xml

?

I am also not sure what the spec says about this mix

-- 
Johan Compagner
Servoy