Here is my doubt
In this book they said "Filters with matching URL patterns are placed in the chain in the order in which they are declared in the DD."
If that so the answer must be Filter1,Filter2,Filter5
If the order of filter mapping is like servlet mapping then also the answer must be Filter1, Filter2, Filter5
SCJP 5.0<br />SCWCD 1.4<br />Preparing for <b>SCEA</b>.<br /><b>"I prefer an interesting vice to a virtue that bores."</b>
SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
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.
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.
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.
SCJP 5.0<br />SCWCD 1.4<br />Preparing for <b>SCEA</b>.<br /><b>"I prefer an interesting vice to a virtue that bores."</b>
SCJP 5.0<br />SCWCD 1.4<br />Preparing for <b>SCEA</b>.<br /><b>"I prefer an interesting vice to a virtue that bores."</b>
Thanks and regards,
Elan
Turn on, tune in, drop out.
SCJP 5.0<br />SCWCD 1.4<br />Preparing for <b>SCEA</b>.<br /><b>"I prefer an interesting vice to a virtue that bores."</b>
When processing a <filter-mapping> element using the <url-pattern>
style, the container must determine whether the <url-pattern> matches the
request URI using the path mapping rules defined in Chapter SRV.11, �Mapping Requests to Servlets�.
Turn on, tune in, drop out.
The order the container uses in building the chain of filters to be applied for a
particular request URI is as follows:
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.
Turn on, tune in, drop out.
<servlet-mapping>
<servlet-name>RedServlet</servlet-name>
<url-pattern>/red/*<url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>BlueServlet</servlet-name>
<url-pattern>/red/red/*<url-pattern>
</servlet-mapping>
<filter-mapping>
<filter-name>RedServletFilter</filter-name>
<url-pattern>/red/*<url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>BlueServletFilter</filter-name>
<url-pattern>/red/red/*<url-pattern>
</filter-mapping>
SCJP 5.0<br />SCWCD 1.4<br />Preparing for <b>SCEA</b>.<br /><b>"I prefer an interesting vice to a virtue that bores."</b>
If there are filters using <url-pattern> matching and the <url-pattern>
matches the request URI according to the rules of Section SRV.11.2, �Specification of Mappings�, the container builds the chain of <url-pattern> matched filters in the same order as declared in the deployment descriptor. The last filter in this chain is the last <url-pattern> matching filter in the deployment descriptor
for this request URI.
(filter mapping Order in the DD)
Turn on, tune in, drop out.
SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
he container builds the chain of <url-pattern> matched filters in the same order as declared in the deployment descriptor.
SCJP 5.0<br />SCWCD 1.4<br />Preparing for <b>SCEA</b>.<br /><b>"I prefer an interesting vice to a virtue that bores."</b>
OK, so that other guy knows Java better than I do, but I bet he can't speak Wuhanese(a Chinese Dialect) like me.
Celinio Fernandes wrote:That is not what the DD is made of.
2nd and 4th filter mappings are mapped to servlet names, not url patterns.
That is why you think the answer is wrong.
OK, so that other guy knows Java better than I do, but I bet he can't speak Wuhanese(a Chinese Dialect) like me.
<filter-mapping>
<filter-name>Filter1</filter-name>
<url-pattern>/Recipes/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Filter2</filter-name>
<servlet-name>/Recipes/HopsList.do</servlet-name>
</filter-mapping>
<filter-mapping>
<filter-name>Filter3</filter-name>
<url-pattern>/Recipes/Add/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Filter4</filter-name>
<servlet-name>/Recipes/Modify/ModRecipes.do</servlet-name>
</filter-mapping>
<filter-mapping>
<filter-name>Filter5</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
OK, so that other guy knows Java better than I do, but I bet he can't speak Wuhanese(a Chinese Dialect) like me.
The airline is called "Virgin"? Don't you want a plane to go all the way? This tiny ad will go all the way:
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
|