• Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt in the order the filters are invoked.  RSS feed

 
Arjun Karthick
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I want to clarify the order in which the filters are invoked.What i understood is
1. the filters are invoked in the order they are declared in the DD.
2. First the Filters for the same URL pattern are called.
3. Then the filters for the same servlets are invoked.

is my understanding correct?
My doubt is on Exercise given in HFJS page 680.
i can't understand the solution given.
How could the order be 1,5,2 ? It should be 1,2,5 na?
As the order of filter declared in DD are 1,2,3,4 and 5

regards
Karthick.J.G
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't own the book, so I can't tell about the exercise,
but as far as the mapping rule is concerned:

1. First, the <url-pattern> matching filter mappings in the same order that these elements appear in the deployment descriptor.
2. Next, the <servlet-name> matching filter mappings in the same order that
these elements appear in the deployment descriptor.
 
Arjun Karthick
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
Got cleared on that exercise.

Karhtick.j.g
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!