• 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

Doubt in Filters HFSJ

 
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.
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • 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.
 
    Bookmark Topic Watch Topic
  • New Topic