nerdexam
GIAC

GSSP-JAVA · Question #146

Mark works as a Programmer for InfoTech Inc. He develops the following code for a Web application named JavaSecurity Application. <web-app . . . .> <display-name>A JavaSecurity…

The correct answer is D. The container will return false. See the full explanation below for the reasoning.

Question

Mark works as a Programmer for InfoTech Inc. He develops the following code for a Web application named JavaSecurity Application. <web-app . . . .> <display-name>A JavaSecurity 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 will be the action of the container if the request is HttpServletRequest, and request.isUserInRole("Admin"); has been called in a servlet code?

Options

  • AThe container will throw a system exception.
  • BThe container will return true.
  • CThe container will throw an application exception.
  • DThe container will return false.

How the community answered

(51 responses)
  • A
    4% (2)
  • B
    12% (6)
  • C
    8% (4)
  • D
    76% (39)

Community Discussion

No community discussion yet for this question.

Full GSSP-JAVA Practice