Maybe because in mappings MyOwnFilter2 is mapped to servlets before MyOwnFilter. Sequence is decided by first the url-pattern then the servlet-name in the order they appear in filter-mapping. Try changing sequence in filter-mapping
On Oct 21, 1:01 pm, peeter brunch <peeterbru...@hotmail.com> wrote: > Hello, > > The order of the filters in the xml is defined in the following order: > > <display-name>hello2</display-name> > <filter> > <filter-name>MyOwnFilter</filter-name> > <filter-class>mypackage.MyOwnFilter</filter-class> > </filter> > <filter> > <filter-name>MyOwnFilter2</filter-name> > <filter-class>mypackage.MyOwnFilter2</filter-class> > </filter> > <filter-mapping> > <filter-name>MyOwnFilter2</filter-name> > <url-pattern>/*</url-pattern> > </filter-mapping> > <filter-mapping> > <filter-name>MyOwnFilter</filter-name> > <url-pattern>/*</url-pattern> > </filter-mappin > > The output log from netbean IDE are shown below: > PWC1412: WebModule[/hello2] ServletContext.log():MyOwnFilter2:Initializing > filter > PWC1412: WebModule[/hello2] ServletContext.log():MyOwnFilter:Initializing > filter > PWC1412: WebModule[/hello2] ServletContext.log():MyOwnFilter2:doFilter() > PWC1412: WebModule[/hello2] > ServletContext.log():MyOwnFilter2:DoBeforeProcessing > PWC1412: WebModule[/hello2] ServletContext.log():MyOwnFilter:doFilter() > PWC1412: WebModule[/hello2] > ServletContext.log():MyOwnFilter:DoBeforeProcessing > PWC1412: WebModule[/hello2] ServletContext.log():MyOwnFilter:DoAfterProcessing > PWC1412: WebModule[/hello2] ServletContext.log():attribute: > com.sun.enterprise.http.sessiontracker=org.apache.coyote.tomcat5.sessiontrac...@64e307 > PWC1412: WebModule[/hello2] > ServletContext.log():MyOwnFilter2:DoAfterProcessing > PWC1412: WebModule[/hello2] ServletContext.log():attribute: > com.sun.enterprise.http.sessiontracker=org.apache.coyote.tomcat5.sessiontrac...@64e307 > PWC1412: WebModule[/hello2] ServletContext.log():MyOwnFilter2:doFilter() > PWC1412: WebModule[/hello2] > ServletContext.log():MyOwnFilter2:DoBeforeProcessing > PWC1412: WebModule[/hello2] ServletContext.log():MyOwnFilter:doFilter() > PWC1412: WebModule[/hello2] > ServletContext.log():MyOwnFilter:DoBeforeProcessing > PWC1412: WebModule[/hello2] ServletContext.log():MyOwnFilter:DoAfterProcessing > PWC1412: WebModule[/hello2] ServletContext.log():attribute: > com.sun.enterprise.http.sessiontracker=org.apache.coyote.tomcat5.sessiontrac...@86caf8 > PWC1412: WebModule[/hello2] > ServletContext.log():MyOwnFilter2:DoAfterProcessing > PWC1412: WebModule[/hello2] ServletContext.log():attribute: > com.sun.enterprise.http.sessiontracker=org.apache.coyote.tomcat5.sessiontrac...@86caf8 > > From the first few lines of the output log above, MyOwnFilter2:initializing > filter and MyOwnFilter2:doFilter/DoBeforeProcessing filter are being logged > before MyOwnFilter. Since MyOwnFilter defined in the XML comes before > MyOwnFilter2, from the log it looks to me MyOwnFilter 2 is executed befor > MyOwnFilter. Anyone can comment on why is the logging sequence out of order? > > Thanks. > > Regards, > Peeter > > _________________________________________________________________ > Hotmail: Trusted email with powerful SPAM > protection.http://clk.atdmt.com/GBL/go/177141665/direct/01/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en -~----------~----~----~----~------~----~------~--~---