This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Doubt on Filters - P.No: 680, HFSJ Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "Doubt on Filters - P.No: 680, HFSJ " Watch "Doubt on Filters - P.No: 680, HFSJ " New topic
Author

Doubt on Filters - P.No: 680, HFSJ

Parameswaran Thangavel
Ranch Hand

Joined: Mar 01, 2005
Posts: 485
Hi Everybody,
in p.no 680 of HFSJ i am surprised on the answers for the Request path 2 and 5.

can any body explain me how the URL matching happens here .Is it same as
Exact, Directory and Extension matching used by container for resource finding, if this is the case, then for the Request path 2 the answer should be 2, 1, 5.

Could any body clear my doubt.

Any help is appreciated.
Gaurav Gambhir
Ranch Hand

Joined: Mar 04, 2006
Posts: 252
<Filter mapping> can be done either using <url-pattern> or <servlet-
name>


Follow this process

All the filters with matching URL pattern are placed in the chain in
the order in which they are declared in DD.

Then all the filters with matching <servlet-name> are placed in the
chain in the order in which they are declared in DD.

Now for example
Recipes/HopsList.do has the matching

<url-pattern>/Recipes/*</url-pattern> ----------------1
<url-pattern>/*</url-pattern> ------------------------5
<servlet-name>/Recipes/HopsList.do</servlet-name> ----2

Here all filters with matching URL patterns are placed first and then
all filters with matching servlet-name

Regards
Gaurav
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Doubt on Filters - P.No: 680, HFSJ
 
Similar Threads
Doubt with web.xml
*** RequestDispatcher doubt ***
Ordering Filters doubt?
SCJP ::: chapter 4 p.no 286 instanceof ..........
doubt on page no.680(old edition) and pageno.712 for new edition HFSJ