org.mortbay.jetty.Request.getSession()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(204)

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

Request.getSession介绍

暂无

代码示例

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

public HttpSession getSession()
{
  return getSession(true);
}

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

HttpSession session=request.getSession(false);

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

public boolean isRequestedSessionIdValid()
{    
  if (_requestedSessionId==null)
    return false;
  
  HttpSession session=getSession(false);
  return (session==null?false:_sessionManager.getIdManager().getClusterId(_requestedSessionId).equals(_sessionManager.getClusterId(session)));
}

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

old_session = base_request.getSession(false);
HttpSession session=base_request.getSession(false);
if (session!=null && session.isNew())
  base_request.saveNewSession(_sessionManager,session);

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

public Principal login(Object credentials, String charset) throws SecurityServiceException {
  String[] decoded = decodeBase64Credentials(credentials, charset);
  HttpGraniteContext graniteContext = (HttpGraniteContext)GraniteContext.getCurrentInstance();
  HttpServletRequest httpRequest = graniteContext.getRequest();
  Request request = httpRequest instanceof Request ? (Request)httpRequest : HttpConnection.getCurrentConnection().getRequest();
  UserRealm realm = request.getUserRealm();
  Principal principal = realm.authenticate(decoded[0], decoded[1], request);
  if (principal == null) {
    if (request.getSession(false) != null)
      request.getSession(false).removeAttribute(JETTY6_AUTH);
    throw SecurityServiceException.newInvalidCredentialsException("Wrong username or password");
  }
  request.setAuthType(AUTH_TYPE);
  request.setUserPrincipal(principal);
  request.getSession().setAttribute(JETTY6_AUTH, principal);
  
  endLogin(credentials, charset);
  return principal;
}

代码示例来源:origin: org.mortbay.jetty/jetty-security

HttpSession session=request.getSession(response!=null);
if (session==null)
  return null;

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

HttpSession session=request.getSession(response!=null);
if (session==null)
  return null;

相关文章