Which HttpServletRequest method is most closely associated with the use of the element
-
isUserInRole
-
getUserPrincipal
-
getCookies
-
getHeader
A
Correct answer
Explanation
isUserInRole(String role) is used to check if the authenticated user belongs to a specified security role. The element in the DD maps a role name used in code (like isUserInRole calls) to an actual security role defined in the container. getUserPrincipal() returns the Principal object, getCookies() retrieves cookies, and getHeader() reads HTTP headers - none of these relate to role-based security reference mapping.