Oracle
1Z0-899 · Question #188
Given this fragment in a servlet: 23. if(reg.isUserInRole("Admin")) { 24. // do stuff 25. } And the following fragment from the related Java EE deployment descriptor: 812. <security-role-ref> 813…
The correct answer is B. The deployment descriptor is NOT valid. See the full explanation below for the reasoning.
Question
Given this fragment in a servlet: 23. if(reg.isUserInRole("Admin")) { 24. // do stuff 25. } And the following fragment from the related Java EE deployment descriptor: 812. <security-role-ref> 813. <role-name>Admin</role-name> 814. <role-link>Administrator</role-link> 815. </security-role-ref> 900. <security-role> 901. <role-name>Admin</role-name> 902. <role-name>Administrator</role-name> 903. </security-role> What is the result?
Options
- ALine 24 can never be reached.
- BThe deployment descriptor is NOT valid.
- CIf line 24 executes, the user's role will be Admin.
- DIf line 24 executes, the user's role will be Administrator.
- EIf line 24 executes, the user's role will NOT be predictable.
How the community answered
(58 responses)- A3% (2)
- B74% (43)
- C7% (4)
- D2% (1)
- E14% (8)
Community Discussion
No community discussion yet for this question.