javax.servlet.http.HttpServletRequestWrapper.getRemoteUser()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(153)

本文整理了Java中javax.servlet.http.HttpServletRequestWrapper.getRemoteUser()方法的一些代码示例,展示了HttpServletRequestWrapper.getRemoteUser()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpServletRequestWrapper.getRemoteUser()方法的具体详情如下:
包路径:javax.servlet.http.HttpServletRequestWrapper
类名称:HttpServletRequestWrapper
方法名:getRemoteUser

HttpServletRequestWrapper.getRemoteUser介绍

[英]The default behavior of this method is to return getRemoteUser() on the wrapped request object.
[中]此方法的默认行为是在包装的请求对象上返回getRemoteUser()。

代码示例

代码示例来源:origin: cloudfoundry/uaa

@Override
public String getRemoteUser() {
  return super.getRemoteUser();
}

代码示例来源:origin: apache/geode

/**
 * {@inheritDoc}
 */
@Override
public String getRemoteUser() {
 if (outerRequest != null) {
  return outerRequest.getRemoteUser();
 } else {
  return super.getRemoteUser();
 }
}

代码示例来源:origin: apache/shiro

public String getRemoteUser() {
  String remoteUser;
  Object scPrincipal = getSubjectPrincipal();
  if (scPrincipal != null) {
    if (scPrincipal instanceof String) {
      return (String) scPrincipal;
    } else if (scPrincipal instanceof Principal) {
      remoteUser = ((Principal) scPrincipal).getName();
    } else {
      remoteUser = scPrincipal.toString();
    }
  } else {
    remoteUser = super.getRemoteUser();
  }
  return remoteUser;
}

代码示例来源:origin: apache/hbase

@Test
public void testFilter() throws Exception {
 FilterConfig config = mockConfig("myuser");
 StaticUserFilter suf = new StaticUserFilter();
 suf.init(config);
 ArgumentCaptor<HttpServletRequestWrapper> wrapperArg =
  ArgumentCaptor.forClass(HttpServletRequestWrapper.class);
 FilterChain chain = mock(FilterChain.class);
 suf.doFilter(mock(HttpServletRequest.class), mock(ServletResponse.class),
   chain);
 Mockito.verify(chain).doFilter(wrapperArg.capture(), Mockito.<ServletResponse>anyObject());
 HttpServletRequestWrapper wrapper = wrapperArg.getValue();
 assertEquals("myuser", wrapper.getUserPrincipal().getName());
 assertEquals("myuser", wrapper.getRemoteUser());
 suf.destroy();
}

代码示例来源:origin: com.atlassian.jira/jira-core

@Override
public String getRemoteUser()
{
  String remoteUser = super.getRemoteUser();
  return remoteUser;
}

代码示例来源:origin: com.liferay.portal/portal-kernel

public String getRemoteUser() {
  if (_remoteUser != null) {
    return _remoteUser;
  }
  else {
    return super.getRemoteUser();
  }
}

代码示例来源:origin: com.github.wuic/wuic-servlet

/**
 * {@inheritDoc}
 */
@Override
public String getRemoteUser() {
  // Synchronized access
  synchronized (mutex) {
    return super.getRemoteUser();
  }
}

代码示例来源:origin: OpenNMS/opennms

@Override
public String getRemoteUser() {
  String remoteUser = (String) getAttribute(HttpContext.REMOTE_USER);
  if (remoteUser == null) {
    remoteUser = super.getRemoteUser();
  }
  return remoteUser;
}

代码示例来源:origin: apache/felix

@Override
public String getRemoteUser()
{
  String remoteUser = (String) getAttribute(HttpContext.REMOTE_USER);
  if (remoteUser != null)
  {
    return remoteUser;
  }
  return super.getRemoteUser();
}

代码示例来源:origin: org.apache.wink/wink-server

@Override
public String getRemoteUser() {
  return getCorrectRequest().getRemoteUser();
}

代码示例来源:origin: org.fcrepo/fcrepo-server

@Override
public String getRemoteUser() {
  String remoteUser = null;
  if (isUserSponsored()) {
    remoteUser = sponsoredUser;
  } else {
    remoteUser = super.getRemoteUser();
    if (remoteUser == null && userPrincipal != null) {
      remoteUser = userPrincipal.getName();
    }
  }
  return remoteUser;
}

代码示例来源:origin: Jasig/uPortal

@Override
public String getRemoteUser() {
  this.checkState();
  return super.getRemoteUser();
}

代码示例来源:origin: com.force.sdk/force-oauth

@Override
public String getRemoteUser() {
  return userP != null ? userP.getName() : super.getRemoteUser();
}

代码示例来源:origin: org.apache.felix/org.apache.felix.http.base

@Override
public String getRemoteUser()
{
  String remoteUser = (String) getAttribute(HttpContext.REMOTE_USER);
  if (remoteUser != null)
  {
    return remoteUser;
  }
  return super.getRemoteUser();
}

代码示例来源:origin: org.jasig.portal/uPortal-rendering

@Override
public String getRemoteUser() {
  this.checkState();
  return super.getRemoteUser();
}

代码示例来源:origin: org.seasar.tuigwaa/tuigwaa-core

public String getRemoteUser() {
  if (user != null) {
    return user.getName();
  }
  return super.getRemoteUser();
}

代码示例来源:origin: org.opennms.container/org.opennms.container.bridge

@Override
public String getRemoteUser() {
  String remoteUser = (String) getAttribute(HttpContext.REMOTE_USER);
  if (remoteUser == null) {
    remoteUser = super.getRemoteUser();
  }
  return remoteUser;
}

代码示例来源:origin: forcedotcom/java-sdk

@Override
public String getRemoteUser() {
  return userP != null ? userP.getName() : super.getRemoteUser();
}

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-api

public String getRemoteUser()
{
  // use the "current" setting for this
  boolean remoteUser = ((Boolean) threadLocalManager.get(CURRENT_REMOTE_USER)).booleanValue();
  if (remoteUser && (m_session != null) && (m_session.getUserEid() != null))
  {
    return m_session.getUserEid();
  }
  return super.getRemoteUser();
}

代码示例来源:origin: sakaiproject/sakai

public String getRemoteUser()
{
  // use the "current" setting for this
  boolean remoteUser = ((Boolean) threadLocalManager.get(CURRENT_REMOTE_USER)).booleanValue();
  if (remoteUser && (m_session != null) && (m_session.getUserEid() != null))
  {
    return m_session.getUserEid();
  }
  return super.getRemoteUser();
}

相关文章

HttpServletRequestWrapper类方法