aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes question on filters from head first Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "question on filters from head first" Watch "question on filters from head first" New topic
Author

question on filters from head first

Sudarshan Sreenivasan
Ranch Hand

Joined: Jun 28, 2007
Posts: 188


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

Joined: Feb 28, 2007
Posts: 1707
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,


cmbhatt
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344


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?


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Sudarshan Sreenivasan
Ranch Hand

Joined: Jun 28, 2007
Posts: 188

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

Joined: Apr 20, 2002
Posts: 510
What happens when you try to code these situations yourself? What behavior do you observe?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: question on filters from head first
 
Similar Threads
HFS - page 703 Q 5
Question 5 of Chapter 13
HF: Filters and Wrappers question
Filter Question
Object equality in Head Fisrt Java 2nd Ed.