Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Marcus Green's Mock Test 3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Marcus Green Watch "Marcus Green New topic

Marcus Green's Mock Test 3

chandan kumar mitwaa
Ranch Hand

Joined: Jul 01, 2009
Posts: 49

Which of the following statements are true?
Choose at least one answer.
A. A filter must extend the HttpFilter class
B. A filter must implement the Filter interface
C. Filters are chained to servlets through the filter tag in the deployment descriptor
D. A filter must be mapped to one and only one servlet
E. A filter may be mapped either to a single servlet or to multiple servlets via a URL pattern

B. C. E. are the solutions.

I do not understand why C. should be correct? We use <filter-mapping> tag to chain filters to a servlet isn't it???

Someone please clear me on this.

Chandan Kumar
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

You are right. Filter tags do not form a filter chain. filter-mapping tags matching a request pattern do.

[My Blog]
All roads lead to JavaRanch
Consider Paul's rocket mass heater.
subject: Marcus Green's Mock Test 3