Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

HFS - page 703 Q 5 - ambiguous options

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q5 Option A: "Filters may be used to create request or response wrappers"
is marked as correct.
How does one create wrappers from filters ???

Q5 Option E: is marked incorrect
How else can one ensure that all filters will have a chance to excute ?
 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Satguru:
A - Your response filter can wrap the response (i.e. can add or modify the response). The example in HFS is the Compression Wrapper where the response is wrapped by a compression filter, so all requests matching the url-pattern you specify automagically get their responses compressed.

E - the key here is the word "must". You might have a filter that wants to stop certain requests from getting through. In this case you would not want to call doFilter since you would not want any further processing of the blocked request.
 
satguru srivastava
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roger,
I understand what the authors are trying to say.
My only point is that the answers can be interpreted in different ways and thus would be a bad choice in exam.
Thanks
Satguru
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dont worried about that, as the exam options would state clearly.

Nick
 
Cowgirl and Author
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy,
I agree with satguru about answer "E". I think it's poorly-worded and you should give yourself a point regardless of how you answer it, because of ways it can be interpreted.

To be 100% clear, it should have left out the last half of the sentence, and just say:

"E. A filter's doFilter() method must call doFilter() on the input FilterChain object."

The part that says, "... in order to ensure that all filters have a chance to execute." is the problem, because while you do not HAVE to call doFilter(), because as Roger said, you might want to stop processing, but if you DO want to ensure the other filters have a chance to execute, then you DO need to call doFilter(). So, this will be on our list of things to improve.

We think answer "A" is worded correctly, though.

Cheers,
Kathy
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic