• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question on filters from head first

 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • 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
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • 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,
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • 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 Java MySQL Database
  • Mark post as helpful
  • send pies
  • 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
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens when you try to code these situations yourself? What behavior do you observe?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic