I saw this answer that suggests to add <absolute-ordering>.
I am using tomcat 7.0.29 and have a few filters which are all defined like this: (not in web.xml)
@WebFilter(filterName = "SessionFilter", servletNames = { "Jersey Web Application" })
public class HibernateSessionRequestFilter implements Filter {
Since I want the session filter to invoked before a filter called authenticationfilter
, I added the following to web.xml between <web-app>
tags.
<absolute-ordering>
<name>SessionFilter</name>
<name>AuthenticationFilter</name>
</absolute-ordering>
However, it doesn't work and authentication filter is executed BEFORE session filter.
Why?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…