<absolute-ordering> is not working in tomcat 7

11,820

Reading the specification, absolute-ordering is used to order the loading of web fragments, not of servlet filters.

To fix the ordering of your filters, see the accepted answer in the question you linked to.

Share:
11,820
Dejell
Author by

Dejell

I like traveling around the world. So far I have been to: USA England Italy Slovania Croatia Jordan South Africa Zimbabwe Botswana France Canada Israel Thailand Switzerland Holland Bulgaria I am going to Vietnam soon

Updated on June 04, 2022

Comments

  • Dejell
    Dejell almost 2 years

    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?

  • Dejell
    Dejell almost 11 years
    Thanks. so why did the answer get so many votes up if the question was regarding filters and not web fragments?
  • JB Nizet
    JB Nizet almost 11 years
    Good question. People probably upvoted blindly, without actually knowing or checking the answer was correct, or without reading the question carefully.