Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Filter invocation order

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

This is listing from my web.xml:

<filter>
<display-name>FilterOne</display-name>
<filter-name>FilterOne</filter-name>
<filter-class>com.FilterOne</filter-class>
</filter>
<filter>
<display-name>FilterTwo</display-name>
<filter-name>FilterTwo</filter-name>
<filter-class>com.FilterTwo</filter-class>
</filter>
<filter>
<display-name>Third</display-name>
<filter-name>Third</filter-name>
<filter-class>com.Third</filter-class>
</filter>

<filter-mapping>
<filter-name>FilterOne</filter-name>
<url-pattern>/red/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>FilterTwo</filter-name>
<url-pattern>/red/red/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Third</filter-name>
<url-pattern>/red/red/red/*</url-pattern>
</filter-mapping>

In each filter i have System.out.println("Filter xxx") before chain.doFilter()
In java ee documentation is written: "order of the filters is the order in which they appear in the deployment descriptor."


So when i'm invoking http://localhost:9080/webTest/red/red/red/* on console should be
Filter ONE
Filter TWO
Filter THREE

But on my console is :

filter THREE - /red/red/red/*
filter ONE - /red/*
filter TWO - /red/red/*

Why ??

I am using WebSphere Application Server v7.0
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please UseCodeTags.
 
Piotr Komisarski
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK.

I found cause of my problem.
In administrative web page of websphere i checked my web.xml and there order of my filters is changed to THREE, ONE, TWO.
But i don't understand this.
Why websphere is changing my web.xml during deployment?
I tried few times and each time order of my filters is shuffled...
 
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"piterboss piterboss", please check your private messages for an important administrative matter.
 
Bear Bibeault
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As this appears to be Websphere-specific it has been moved to the Webshpere forum.
 
It will give me the powers of the gods. Not bad for a tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic