Page 1 of 1

About Question enthuware.jwpv6.2.1085 :

Posted: Wed Aug 17, 2016 1:32 pm
by johnlong
This error page mapping will only be used if NoLicenseException is made to extend from RuntimeException.It is not the only way to get it working.
If it works, why answer is marked as wrong?

Re: About Question enthuware.jwpv6.2.1085 :

Posted: Wed Aug 17, 2016 8:43 pm
by admin
Did you read the explanation?
The option says that it is the only way. The explanation says that it is not the only way.

Re: About Question enthuware.jwpv6.2.1085 :

Posted: Thu Aug 18, 2016 12:22 am
by johnlong
Yes, I understand, if it is NOT the only way, why not choose this way?

Re: About Question enthuware.jwpv6.2.1085 :

Posted: Thu Aug 18, 2016 8:55 am
by admin
The option claims that it is the only way. Is it the only way? No. So it is a wrong option.

Re: About Question enthuware.jwpv6.2.1085 :

Posted: Thu Aug 18, 2016 4:38 pm
by johnlong
Yes, I see now, I missed that part of question. Thank you.

Re: About Question enthuware.jwpv6.2.1085 :

Posted: Mon Jun 04, 2018 2:32 am
by mart1jn
sorry to bump this topic, but I have a follow-up question based on the original one. You're saying that the option ...
This error page mapping will only be used if NoLicenseException is made to extend from RuntimeException.
... is wrong due to the word "only". However the option marked as correct also has the word "only":
As such, this error page mapping will only be used if a servlet wraps this exception into a ServletException and then throws the ServletException.
To me the reasoning isn't consistent. But perhaps you could explain.

Re: About Question enthuware.jwpv6.2.1085 :

Posted: Mon Jun 04, 2018 10:42 pm
by admin
The reasoning is valid in both the options. It is not always just the word "only" that makes an option right or wrong. You have to read the whole statement.
In this case, think of it this way - Can you show me any other way the given error page mapping can be used even if a servlet doesn't wrap this exception into a ServletException given that NoLicenseException extends Exception?

If no, then the option is correct i.e. the only way this mapping will be used is if a servlet throws the NoLicenseException after wrapping it into a ServletException.