• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Filter init() method

 
Puneet Vashisht
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guyz,,


Plz verify if this statement is true!!

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

To me this statements is true, but according to HF its false, n i dont see any reason mentioned for it.

Any suggestions..

puneet.
SCJP 1.4, SCBCD
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It could be because the method actually has signature init(FilterConfig)?
Otherwise it seems a fair statement.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would say that init() is called only once.
So "guaranteed to be called before the filter is used to handle requests" would be true before the first request only.

This sentence is too ambiguous.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So "guaranteed to be called before the filter is used to handle requests" would be true before the first request only.

No, that is always true, for any and all requests. "Before the request" means "at some point it time before the request", it does not mean "right before the request".

But the important point is that there is indeed no init() method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic