FileDocCategorySizeDatePackage
ServletPrincipalProxy.javaAPI DocExample1741Mon Jul 23 13:26:28 BST 2007org.apache.struts2.servlet.interceptor

ServletPrincipalProxy

public class ServletPrincipalProxy extends Object implements org.apache.struts2.interceptor.PrincipalProxy
PrincipalProxy implementation for using HttpServletRequest Principal related methods.

Fields Summary
private HttpServletRequest
request
Constructors Summary
public ServletPrincipalProxy(HttpServletRequest request)
Constructs a proxy

param
request The underlying request

        this.request = request;
    
Methods Summary
public java.lang.StringgetRemoteUser()
Gets the user id

return
The user id

        return request.getRemoteUser();
    
public javax.servlet.http.HttpServletRequestgetRequest()
Gets the request.

return
The request
deprecated
To obtain the HttpServletRequest in your action, use {@link org.apache.struts2.servlet.ServletRequestAware}, since this method will be dropped in future.

        return request;
    
public java.security.PrincipalgetUserPrincipal()
Gets the user principal

return
The principal

        return request.getUserPrincipal();
    
public booleanisRequestSecure()
Is the request using https?

return
True if using https

        return request.isSecure();
    
public booleanisUserInRole(java.lang.String role)
True if the user is in the given role

param
role The role
return
True if the user is in that role

        return request.isUserInRole(role);