• 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

question on filters from head first

 
Ranch Hand
Posts: 188
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Filters support a initialization mechanism that includes an init() method that is gauranteed to be called before the filter is used to handle requests



Is this statement true or false

The book states it as false

I think it is true .. some please clarify

It is given as one of the options for question no 5 page no 703 in the head first book


Thanks
 
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Servlet Specification:


The container must ensure that it has instantiated a filter of the appropriate
class for each filter in the list, and called its init(FilterConfig config)
method. The filter may throw an exception to indicate that it cannot function
properly. If the exception is of type UnavailableException, the container may
examine the isPermanent attribute of the exception and may choose to retry the
filter at some later time.



Thanks,
 
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


The filter may throw an exception to indicate that it cannot function
properly



Thanks for the details from spec chandra.

The presence of aforesaid particular statement make the question posted by OP become "false". Is that right?
 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The question only asks if the init() method is called or not ... rather than completes or not !!

So... i think its still true even in the light of the new info !!!

But the book says its false !!

So need more clarifications !!

Thanks
 
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What happens when you try to code these situations yourself? What behavior do you observe?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic