Multiple choice technology programming languages

Which HttpServletRequest method is most closely associated with the use of the element

  1. isUserInRole

  2. getUserPrincipal

  3. getCookies

  4. getHeader

Reveal answer Fill a bubble to check yourself
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.