Page 1 of 1
About Question enthuware.jwpv6.2.1141 :
Posted: Sun Jan 27, 2013 5:27 am
by ETS User
Hi. Sorry for my English, it is not my native language. But I don`t understand, why the second answer is not true? Is it true that I should past the filter control code into doFilter method?
Re: About Question enthuware.jwpv6.2.1141 :
Posted: Sun Jan 27, 2013 7:26 am
by admin
Usually, a filter calls, chain.doFilter(request, wrapper); at the end of its doFilter method, which passes the control to the actual resource that was requested by the client.
However, a filer may decide not to continue further processing of a request and in that case, it may choose not to call chain.doFilter(request, wrapper); at all. In this case, the actual resource (such as a JSP or Servlet) may not even be invoked.
So the point is, it is not a must for a filter to pass the control to the resource on which the filter is applied.
HTH,
Paul.
Re: About Question enthuware.jwpv6.2.1141 :
Posted: Sun Jan 27, 2013 7:57 am
by ETA User
Thanks Paul. I get it
Re: About Question enthuware.jwpv6.2.1141 :
Posted: Sat Apr 06, 2013 4:38 am
by sebastien
Hi,
Just a little stuff i've noticed
it's isPermanent() not "This happens only if the isParmanent attribute of the UnavailableException is true. Otherwise, the container will try to initialize it again after some time."
not an important point but for non native spoker it could be confusing
Sébastien
Re: About Question enthuware.jwpv6.2.1141 :
Posted: Sat Apr 06, 2013 6:23 am
by admin
Thank you, Sébastien. This has now been updated.
-Paul.
Re: About Question enthuware.jwpv6.2.1141 :
Posted: Thu Feb 19, 2015 10:20 pm
by tanzwud
Hello .
Could you please explain why option 1 is valid?
"The init method of the filter is called only once before a request is made to the resource it is associated with."
This is from Java Doc. "The servlet container calls the init method exactly once after instantiating the filter. The init method must complete successfully before the filter is asked to do any filtering work." What means for me that the init() method has nothing with with actually "called once before a request is made" since no matter is there is any call to resource or no calls att all to the resource. As for me the answer looks like "init() only called once at first request to the resource" which is ambigous and not correct.
Thanks for help.
Re: About Question enthuware.jwpv6.2.1141 :
Posted: Thu Feb 19, 2015 11:14 pm
by admin
You are right. Although the option is trying to get at the same point but I can see why it can interpreted differently. It has now been updated.
thank you for your feedback!
Paul.