• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ questions p 699

 
Aaron John
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a couple of questions on questions 5 and 6 regarding Filters and Wrappers. The questions are on p 699

Question 5: Which about filters are true?
The answers for the question are A and G. But I was wondering about D: Filters support an initialization mechanism that includes an init() method that is guaranteed to be called before the filter is used to handle requests.

The filter does has an init() method and is called before the filter is used to handle requests. Is the above answer also correct for that question?

Question 6: Which are true about the servlet Wrapper classes?
The answers for the question is C. But I was wondering about F: When you subclass a wrapper class, you must override at least one of the wrapper class's methods.

If you don't override any methods in your wrapper class, it still shows the same behaviour of the wrapped object, hence you must override one of the class's methods in order to have a specialised object.

Can anyone clarify these answers? Thanks.
 
Tha�s Manfrim Firmino
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
About question 6, what you said is true, I mean, if you don't override, you don't specialize it. But when they ask must, it means, the implementation won't work at least you do that and the implementation work even if you don't override any method, that's why this answer is wrong.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic