This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HFSJ questions p 699 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HFSJ questions p 699" Watch "HFSJ questions p 699" New topic

HFSJ questions p 699

Aaron John
Ranch Hand

Joined: May 30, 2005
Posts: 74
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

Joined: Apr 12, 2004
Posts: 48
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.

Tha�s M. K. M. Firmino
wood burning stoves
subject: HFSJ questions p 699
Similar Threads
Errata on HF question on page 699?
Filter init() method
HF: Filters and Wrappers question
Filter init()
Filter Question