• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Am I too picky or is this question wrong..?

 
Jean Robillard
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following statements are true?

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

The answers are B, C, and E, but I don't agree with C. I believe the filters are chained to servlets through the "<filter-mapping>", not "<filter>" tag, because <filter> declares a filter, not saying anything about the associated servlet.

Am I being too picky or is the question wrong..? Thanks.
 
Ashish Gauswami
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you are too picky. but i would like to see some Authors or Gurus take on this.
 
Eurig Jones
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think you're being too picky at all. That would've put me off C also.

The exam expects US to be spot on precise so THEY better be as well!
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you really want to be picky (which is good ), filters are chained to other filters, and it is the final filter in the chain which then passes the request to either a servlet (including a JSP) or a static resource. It is the <filter-mapping> tag in the DD which declares a filter to be part of a filter chain for a matching request, and the order of the tags in the DD is synonymous with the order of the filters in the chain.

You're not being too picky, you are correct that option C contains that mistake! Where does the question come from?
 
Ashish Gauswami
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dont say that its from Enthuware...i have already purchased it and i am doing mocks right now.
 
Jean Robillard
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To answer Charles's question, the question is from Marcus Green's mock exam 3.

http://www.examulator.com/moodle/course/view.php?id=5&topic=all

I'm not trying to knock Marcus here, I think his mock exams are really helpful.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic