• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in Filters HFSJ

 
Swathi Sri
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

5th question in page 703 of HFSJ is as follows:

Which about the filters are true?

Here are the answers given:
A.Filters may be used to create request or response wrappers
G.Filter's doFilter() may block further request processing.

My doubts:
How option A is correct?
Filters can use request or response wrappers to modify the request or response sent to/from servlet. But how Filters are used to create wrappers?

Why Option " D.Filters support an initialization mechanism that includes an init() method that is guaranteed to be called before the filter is used to handle the requests " is INCorrect??

Thanks & Regards,
Swathi.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For A, the Filter API does not include anything for creating wrappers, but in a filter is where a developer will typically create and utilize wrappers. If you want to wrap a request or response, a filter is the place to do so.

For D, you ought to check the errata. It says that option D should be checked.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic