Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Marcus Green's Mock Test 3

 
chandan kumar mitwaa
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
24.

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.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right. Filter tags do not form a filter chain. filter-mapping tags matching a request pattern do.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic