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.
Request PathFilter Sequence ------------ ---------------- /Recipes/HopReport.do---->1,5(ok) /Recipes/HopsList.do---->1,5,2(why not 1,2,5 ) /Recipes/Modify/ModRecipes.do---->1,5,4(why not 1,4,5 ) /HopsList.do---->5(ok) /Recipes/Add/AddRecipes.do---->1,3,5(ok)
Filter url matching sequence is determined by sequence in DD. i.e if two or more url matches then there sequence will be determined by sequence in DD.
I have doubt in Request Path 2nd and Request Path 3rd
For 2nd path the sequence should be 1,2,5 as per DD sequence Same way For 3rd path the sequence should be 1,4,5 as per DD sequence
Thanks
aanal jethalia
Greenhorn
Joined: Nov 16, 2006
Posts: 13
posted
0
for filter 2 and filter 4 instead of <url-pattern> element there is <servlet-name> element in Head First. Filter chain will have the matching url-patterns first and then the matching servlet-name.
Pallavi Roy
Ranch Hand
Joined: Jun 01, 2006
Posts: 37
posted
0
Hi, As mentioned earlier that your question is wrong copied. Change the options to <servlet-name> <url-pattern>/Recipes/HopsList.do</url-pattern> and <url-pattern>/Recipes/Modify/ModRecipes.do</url-pattern>.
They rule is the url mentioned is mapped to the <filter-mapping> a) Group the matching <url-pattern> in the sequence they appear in the DD. b) Group the matching <servlet-name> in the sequence they appear in the DD.
This rule will determine the filter sequence.
Break the ice - SCJP 1.4,<br />Where There's a will- SCWCD 1.4.<br />Back in action - Websphere Certified Portal 6 Application Developer
Gowher Naik
Ranch Hand
Joined: Feb 07, 2005
Posts: 643
posted
0
thanks i got it
Niranjan Deshpande
Ranch Hand
Joined: Oct 16, 2005
Posts: 1277
posted
0
this is a age old question filters with url-pattern are executed before serlvets
SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ] Performance is a compulsion, not a option, if my existence is to be justified.
Renu Radhika
Ranch Hand
Joined: Oct 21, 2005
Posts: 243
posted
0
only the order in DD matters is it?I thought its from most matching to the least say if url is like /recipes/ind/chat.do
then if there is an exact match like the one above then that will be selected first followed by /recipes/ind then /recipes then /* can anyone explain?
Pallavi Roy
Ranch Hand
Joined: Jun 01, 2006
Posts: 37
posted
0
Hi Renuka, The order you mention is for servlet declaration <servlet-mapping> <servlet-name> <url-pattern> </servlet-mapping>
where the order goes like 1)Exact match 2)directory match 3)/*.xyz match.
But when it comes to filters this order is not followed. If you see the book then in the bang section you will find this note.