• Post Reply Bookmark Topic Watch Topic
  • New Topic

Filters and Wrappers (HFS)

 
Nitish Bahadur
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pg 703, Question 5?

Option E: (True / False)
A filter's doFilter() method must call doFilter() on the input FilterChain() object in order to ensure that all filters have a chance to execute.

As per author, Option E is incorrect because calling doFilter() is not necessary if a filter wishes to block further request processing.

My Question: Why is this incorrect? Please help me understand this. The question is NOT whether "A filter's doFilter() method must call doFilter() on the input FilterChain() object" BUT "A filter's doFilter() method must call doFilter() on the input FilterChain() object in order to ensure that all filters have a chance to execute."
 
sundar katluri
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the same question while checking the answers (coffee cram) on HFS!!

Is this question formatted wrong??
ofcourse
"doFilter() is not necessary if a filter
wishes to block further request processing." --> this is correct
but the question here is "giving chance to other filters in the chain" that is only possible if you call chain.doFilter(req,resp).
am I wrong?
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!