File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HFSJ Page 696 decalring filters in DD Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HFSJ Page 696 decalring filters in DD" Watch "HFSJ Page 696 decalring filters in DD" New topic

HFSJ Page 696 decalring filters in DD

Satyajeet Kadam
Ranch Hand

Joined: Oct 19, 2006
Posts: 224
which is true about declaring filters in dd?

a)unlike servlets,filters cannot have initialization parameters.

b) Filter chain order is always determined by order the elements appear in dd.

c)A class that extends an API request or reponse wrapper class
must be declared in dd.

d)A class that extends an API request or response wrapper class is
using the Intercepting Filter pattern.

e) Filter chain is afftected by whether filter mappings are
declared via <url-pattern> or via <servlet-name>

Ans) e

But i don't understand why it is not B ?

PLease correct me if i am wrong.

FilerManager creates filter chain by matching requested URI.
It executes filter one by one unitl it reaches target resource. THis
order is determined by the order of the elements appear in DD.

first it locates
1) filters with matching url pattern then
2) it find filter mapping with <servlet-name>
Jay Palaniappan

Joined: Jul 10, 2008
Posts: 3
Hi Amol,
The filter mappings can be defined in DD in 2 ways. One by servlet-name another by url-pattern. In below example 3 filters are defined. 2 are based on URL patterns and 1 with servlet name. Even though the servlet-name filter appears first in the DD, when the container builds the Filter Chain it looks at the URL pattern filter definitions first and then look at the servlet-name filter definitions.




I agree. Here's the link:
subject: HFSJ Page 696 decalring filters in DD
It's not a secret anymore!