nerdexam
GIAC

GSSP-JAVA · Question #230

Mark works as a Programmer for InfoTech Inc. He develops the following deployment descriptor code. <web-app . . . .> <display-name>A Secure Application</display-name><servlet> ... <security-role-ref…

The correct answer is B. request.isUserInRole("Manager"). See the full explanation below for the reasoning.

Question

Mark works as a Programmer for InfoTech Inc. He develops the following deployment descriptor code. <web-app . . . .> <display-name>A Secure Application</display-name><servlet> ... <security-role-ref > <role-name>Manager</role-name> <role-link>Admin</role-link> </security-role-ref> </servlet> <security-role> <role-name>Programmer</role-name> </security-role> <security-role> <role-name>Admin</role-name> </security-role> <security-role> <role-name>Employee</role-name> </security-role> </web-app> Which of the following is a valid isUserInRole() method call that can be made if request is the HttpServletRequest request?

Options

  • Arequest.isUserInRole("Programmer");
  • Brequest.isUserInRole("Manager");
  • Crequest.isUserInRole("Admin");
  • Drequest.isUserInRole("Employee");

How the community answered

(33 responses)
  • A
    3% (1)
  • B
    79% (26)
  • C
    12% (4)
  • D
    6% (2)

Community Discussion

No community discussion yet for this question.

Full GSSP-JAVA Practice