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

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

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

HttpServletRequestWrapper.getSession介绍

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

代码示例

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

@Override
public HttpSession getSession(boolean create) {
  return super.getSession(create);
}

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

@Override
public HttpSession getSession() {
  return super.getSession();
}

代码示例来源:origin: geoserver/geoserver

@Override
public HttpSession getSession(boolean create) {
  HttpSession session = super.getSession(false);
  session = super.getSession(true);
  return session;

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

public HttpSession getSession(boolean create) {
  HttpSession httpSession;
  if (isHttpSessions()) {
    httpSession = super.getSession(false);
    if (httpSession == null && create) {
      //Shiro 1.2: assert that creation is enabled (SHIRO-266):
      if (WebUtils._isSessionCreationEnabled(this)) {
        httpSession = super.getSession(create);
      } else {
        throw newNoSessionCreationException();
      }
    }
  } else {
    boolean existing = getSubject().getSession(false) != null;
    
    if (this.session == null || !existing) {
      Session shiroSession = getSubject().getSession(create);
      if (shiroSession != null) {
        this.session = new ShiroHttpSession(shiroSession, this, this.servletContext);
        if (!existing) {
          setAttribute(REFERENCED_SESSION_IS_NEW, Boolean.TRUE);
        }
      } else if (this.session != null) {
        this.session = null;
      }
    }
    httpSession = this.session;
  }
  return httpSession;
}

代码示例来源:origin: webx/citrus

@Override
  public HttpSession getSession(boolean create) {
    if (create) {
      sessionCreated = true;
    }
    return super.getSession(create);
  }
}

代码示例来源:origin: webx/citrus

@Override
public HttpSession getSession() {
  sessionCreated = true;
  return super.getSession();
}

代码示例来源:origin: webx/citrus

@Override
  public HttpSession getSession(boolean create) {
    if (create) {
      sessionCreated = true;
    }
    return super.getSession(create);
  }
}

代码示例来源:origin: webx/citrus

@Override
public HttpSession getSession() {
  sessionCreated = true;
  return super.getSession();
}

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

HttpSession nativeSession = super.getSession();
try {
 session = (GemfireHttpSession) manager.wrapSession(context,

代码示例来源:origin: paoding-code/paoding-rose

@Override
public HttpSession getSession(boolean create) {
  HttpSession session = super.getSession(false);
  if (session != null) {
    return session;
  }
  if (create) {
    if (window.getContainer().getInvocation().getResponse().isCommitted()) {
      session = new SessionAfterCommitted(new IllegalStateException(
          "Cannot create a session after the response has been committed"));
    } else {
      try {
        session = super.getSession(true);
      } catch (IllegalStateException e) {
        session = new SessionAfterCommitted(e);
      }
    }
  }
  return session;
}

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

@Override
public HttpSession getSession(final boolean create)
{
  HttpSession session = super.getSession(create);
  return session;
}

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

@Override
public HttpSession getSession()
{
  HttpSession session = super.getSession();
  return session;
}

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

/**
 * {@inheritDoc}
 */
@Override
public HttpSession getSession(final boolean create) {
  // Synchronized access
  synchronized (mutex) {
    return super.getSession(create);
  }
}

代码示例来源:origin: org.apache.portals.pluto/pluto-container

@Override
public HttpSession getSession(boolean create) {
 if (isClosed) return null;
 return session != null ? session : super.getSession(create);
}

代码示例来源:origin: org.apache.portals.pluto/pluto-container

@Override
public HttpSession getSession() {
 if (isClosed) return null;
 return session != null ? session : super.getSession();
}

代码示例来源:origin: org.apache.axis2/axis2-transport-http

@Override
  public HttpSession getSession(boolean create) {
    HttpSession session = super.getSession(false);
    if (create && session == null) {
      throw new IllegalStateException("Session creation forbidden");
    } else {
      return session;
    }
  }
}

代码示例来源:origin: com.cloudbees/vietnam4j-core

@Override
  public HttpSession getSession(boolean create) {
    HttpSession base = super.getSession(create);
    if (base==null)     return null;

    return webApp.getProxiedSession(base);
  }
}

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

@Override
public HttpSession getSession() {
  this.checkState();
  return super.getSession();
}

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

@Override
public HttpSession getSession(boolean create) {
  //need to wrap the session so get/setAttribute and get/putValue implementations handle Resources efficiently:
  HttpSession session = super.getSession(create);
  if (session != null) {
    session = new StormpathHttpSession(session);
  }
  return session;
}

代码示例来源:origin: com.hazelcast/hazelcast-all

HttpSession getOriginalSession(boolean create) {
  // Find the top non-wrapped Http Servlet request
  HttpServletRequest req = (HttpServletRequest) getRequest();
  while (req instanceof HttpServletRequestWrapper) {
    req = (HttpServletRequest) ((HttpServletRequestWrapper) req).getRequest();
  }
  if (req != null) {
    return req.getSession(create);
  } else {
    return super.getSession(create);
  }
}

相关文章

HttpServletRequestWrapper类方法