About Question enthuware.jwpv6.2.975 :

Moderator: admin

Post Reply
ETS User

About Question enthuware.jwpv6.2.975 :

Post by ETS User »

Tried on Glassfish 3.1.1. and both isUserInRole("BOSS") and isUserInRole("manager") return true.

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

Re: About Question enthuware.jwpv6.2.975 :

Post by admin »

As per section 13.3:
"
The isUserInRole method expects a String user role-name parameter. A securityrole-ref element should be declared in the deployment descriptor with a rolename sub-element containing the role name to be passed to the method. A security-role-ref element should contain a role-link sub-element whose value is the name of the security role that the user may be mapped into. The container uses the mapping of security-role-ref to security-role when determining the return value of the call.
...

If no security-role-ref element matching a security-role element has been declared, the container must default to checking the role-name element argument against the list of security-role elements for the web application."
The question asks what would you use in the code. So, ideally, you should use the role-name in the servlet code.

HTH,
Paul.

alex
Posts: 42
Joined: Tue Feb 12, 2013 4:35 pm
Contact:

Re: About Question enthuware.jwpv6.2.975 :

Post by alex »

Hi Paul
There is an ambiguous question.
We can usee either "BOSS" or "manager".
Yes, it is not reccomended but it works.
If you don't agree with this why you allow this answer at question enthuware.jwpv6.2.941?
Please keep only one right option in each question.

Thanks,
Alex

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

Re: About Question enthuware.jwpv6.2.975 :

Post by admin »

Hi Alex,
We keep such answers in some questions intentionally to sensitize the user with such ambiguous answers. You will see such questions and answer in the real exam as well.
It is very easy for us to remove such question than to hear people complain about it but then we won't be doing our jobs well in that case.
This discussion serves as good information for other users who think on the same lines.

HTH,
Paul.

alex
Posts: 42
Joined: Tue Feb 12, 2013 4:35 pm
Contact:

Re: About Question enthuware.jwpv6.2.975 :

Post by alex »

Thanks for quick reply.
It sounds reasonable.

Sometimes you give me more information in your explanations than I can find it at google/books.
Thank you for your work, guys!

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests