aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Doubt on HFSJ Ch 13 mock ques #5. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Doubt on HFSJ Ch 13 mock ques #5." Watch "Doubt on HFSJ Ch 13 mock ques #5." New topic
Author

Doubt on HFSJ Ch 13 mock ques #5.

Connie Ky Leung
Ranch Hand

Joined: Jan 29, 2006
Posts: 42
Hi all,

I got question 5 on chapter 13 wrong after reading HFJS twice. I wonder why one of the correct answers is A. The statement of choice A is "Filter is used to create request and response wrappers.". Answers at the back of the chapter indicate that explanation can be found on page 51 of servlet specfication. I read that page but did not spot any sentence that states that fact.

Can someone please help me clear my doubt?

Thanks and regards,

Connie Leung


SCJP 1.4 - 91%, SCWCD - 97%, SCJP 5.0 - 83%, SCJP 6.0, OCEJWCD - 80%
Ken Young
Greenhorn

Joined: Feb 19, 2006
Posts: 12
I came across the same question and wondered the same thing.

Option A: "Filters may be used to create request or response wrappers."
Option B: "Wrappers may be used to create request or response filters."

I picked option B (twice! >_< even though the answer is option A with the explanation "option B is incorrect because the terminology is reversed."

I picked option B because I thought a class that implements the Filter interface (the "request or response filter") uses/instantiates other wrapper classes in the doFilter() method, like the example on page 690. Doesn't that mean wrappers can be "used to create" request or response filters (option B)?

Now I read a few times more, I would choose option A if it means something like "I can use the Filter mechanism to pass wrappers for request/response objects to the servlet", hence filters can be "used to create" request or response wrappers.

Why is my first explanation incorrect?? Or am I just confused on the English here.....
Steven Colley
Ranch Hand

Joined: Feb 18, 2005
Posts: 290
My guess is that we need to be simpler here.

Does not exist neither "request filter objects" nor "response Filter objects".
--> ""Wrappers may be used to create request or response filters.""

Filters can only create another mechanism to "decorate" real request and response objects, improving it before sending back to the client.

So Filters create "decorators objects" (wrapper classes) for doing this.
--> "Filters may be used to create request or response wrappers".

regards,


SCJP | SCWCD | SCBCD | SCWSD 5 | SCEA (I) 1.4 | SCEA 5 | IBM SOA 669
Connie Ky Leung
Ranch Hand

Joined: Jan 29, 2006
Posts: 42
Thanks for replying.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt on HFSJ Ch 13 mock ques #5.