About Question enthuware.jwpv6.2.1141 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
ETS User

About Question enthuware.jwpv6.2.1141 :

Post 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?

admin
Site Admin
Posts: 10389
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.1141 :

Post 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.

ETA User

Re: About Question enthuware.jwpv6.2.1141 :

Post by ETA User »

Thanks Paul. I get it

sebastien
Posts: 12
Joined: Tue Mar 26, 2013 2:38 pm
Contact:

Re: About Question enthuware.jwpv6.2.1141 :

Post 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

admin
Site Admin
Posts: 10389
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.1141 :

Post by admin »

Thank you, Sébastien. This has now been updated.
-Paul.

tanzwud
Posts: 19
Joined: Mon Sep 01, 2014 9:45 pm
Contact:

Re: About Question enthuware.jwpv6.2.1141 :

Post 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.

admin
Site Admin
Posts: 10389
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.1141 :

Post 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.

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests