Prev Next

Java / Servlet Interview Questions

What are the methods of the HttpServletRequest object often used to implement programmatic authorization checks?

getRemoteUser() returns the login of the users making this request if the user has been authenticated; returns null if the user is not authenticated.

isUserInRole() returns a boolean indicating whether the authenticated user is included in the specified role.

getUserPrincipal() returns a java.security.Principal object containing the name of the current authenticated user.

More Related questions...

Show more question and Answers...


Comments & Discussions