• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt in Filters HFSJ

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic