I thought its always randome, n no way to specify the sequence.

Maybe you shouldn't take into consideration tat one filter should proceed
after another when it completely finish.

 

From: java-ee-j2ee-programming-with-passion@googlegroups.com
[mailto:java-ee-j2ee-programming-with-pass...@googlegroups.com] On Behalf Of
peeter brunch
Sent: Wednesday, October 21, 2009 4:01 PM
To: j2ee passion
Subject: [java ee programming] Filter logging order is out of sequence

 

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:
<mailto:com.sun.enterprise.http.sessionTracker=org.apache.coyote.tomcat5.Ses
siontrac...@64e307>
com.sun.enterprise.http.sessionTracker=org.apache.coyote.tomcat5.SessionTrac
k...@64e307
PWC1412: WebModule[/hello2]
ServletContext.log():MyOwnFilter2:DoAfterProcessing
PWC1412: WebModule[/hello2] ServletContext.log():attribute:
<mailto:com.sun.enterprise.http.sessionTracker=org.apache.coyote.tomcat5.Ses
siontrac...@64e307>
com.sun.enterprise.http.sessionTracker=org.apache.coyote.tomcat5.SessionTrac
k...@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:
<mailto:com.sun.enterprise.http.sessionTracker=org.apache.coyote.tomcat5.Ses
siontrac...@86caf8>
com.sun.enterprise.http.sessionTracker=org.apache.coyote.tomcat5.SessionTrac
k...@86caf8
PWC1412: WebModule[/hello2]
ServletContext.log():MyOwnFilter2:DoAfterProcessing
PWC1412: WebModule[/hello2] ServletContext.log():attribute:
<mailto:com.sun.enterprise.http.sessionTracker=org.apache.coyote.tomcat5.Ses
siontrac...@86caf8>
com.sun.enterprise.http.sessionTracker=org.apache.coyote.tomcat5.SessionTrac
k...@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. Sign up
<http://clk.atdmt.com/GBL/go/177141665/direct/01/>  now.

 


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to