org.eclipse.jetty.server.Request.getContextPath()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(10.1k)|赞(0)|评价(0)|浏览(100)

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

Request.getContextPath介绍

暂无

代码示例

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

private String getBasePath(final Request request) {
  final String contextPath = request.getContextPath();
  if (contextPath == null || contextPath.isEmpty()) {
    return "/";
  } else if (contextPath.charAt(contextPath.length() - 1) != '/') {
    return contextPath + "/";
  } else {
    return contextPath;
  }
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionManager != null && !_sessionManager.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (_sessionManager == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionManager.newHttpSession(this);
  HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _connection.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionManager != null && !_sessionManager.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (_sessionManager == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionManager.newHttpSession(this);
  HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _connection.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionManager != null && !_sessionManager.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (_sessionManager == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionManager.newHttpSession(this);
  HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _connection.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionManager != null && !_sessionManager.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (_sessionManager == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionManager.newHttpSession(this);
  HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _connection.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: org.eclipse.jetty/server

public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionManager != null && !_sessionManager.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (_sessionManager == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionManager.newHttpSession(this);
  HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _connection.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

@Override
public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionManager != null && !_sessionManager.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (_sessionManager == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionManager.newHttpSession(this);
  HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _channel.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

@Override
public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionManager != null && !_sessionManager.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (_sessionManager == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionManager.newHttpSession(this);
  HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _channel.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

public String changeSessionId()
{
  HttpSession session = getSession(false);
  if (session == null)
    throw new IllegalStateException("No session");
  if (session instanceof AbstractSession)
  {
    AbstractSession abstractSession =  ((AbstractSession)session);
    abstractSession.renewId(this);
    if (getRemoteUser() != null)
      abstractSession.setAttribute(AbstractSession.SESSION_KNOWN_ONLY_TO_AUTHENTICATED, Boolean.TRUE);
    if (abstractSession.isIdChanged())
      _channel.getResponse().addCookie(_sessionManager.getSessionCookie(abstractSession, getContextPath(), isSecure()));
  }
  return session.getId();
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

public String changeSessionId()
{
  HttpSession session = getSession(false);
  if (session == null)
    throw new IllegalStateException("No session");
  if (session instanceof AbstractSession)
  {
    AbstractSession abstractSession =  ((AbstractSession)session);
    abstractSession.renewId(this);
    if (getRemoteUser() != null)
      abstractSession.setAttribute(AbstractSession.SESSION_KNOWN_ONLY_TO_AUTHENTICATED, Boolean.TRUE);
    if (abstractSession.isIdChanged())
      _channel.getResponse().addCookie(_sessionManager.getSessionCookie(abstractSession, getContextPath(), isSecure()));
  }
  return session.getId();
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server

public String changeSessionId()
{
  HttpSession session = getSession(false);
  if (session == null)
    throw new IllegalStateException("No session");
  if (session instanceof AbstractSession)
  {
    AbstractSession abstractSession =  ((AbstractSession)session);
    abstractSession.renewId(this);
    if (getRemoteUser() != null)
      abstractSession.setAttribute(AbstractSession.SESSION_CREATED_SECURE, Boolean.TRUE);
    if (abstractSession.isIdChanged())
      _channel.getResponse().addCookie(_sessionManager.getSessionCookie(abstractSession, getContextPath(), isSecure()));
  }
  return session.getId();
}

代码示例来源:origin: Nextdoor/bender

public String changeSessionId()
{
  HttpSession session = getSession(false);
  if (session == null)
    throw new IllegalStateException("No session");
  if (session instanceof AbstractSession)
  {
    AbstractSession abstractSession =  ((AbstractSession)session);
    abstractSession.renewId(this);
    if (getRemoteUser() != null)
      abstractSession.setAttribute(AbstractSession.SESSION_KNOWN_ONLY_TO_AUTHENTICATED, Boolean.TRUE);
    if (abstractSession.isIdChanged())
      _channel.getResponse().addCookie(_sessionManager.getSessionCookie(abstractSession, getContextPath(), isSecure()));
  }
  return session.getId();
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server

@Override
public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionManager != null && !_sessionManager.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (getResponse().isCommitted())
    throw new IllegalStateException("Response is committed");
  if (_sessionManager == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionManager.newHttpSession(this);
  HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _channel.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: Nextdoor/bender

@Override
public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionManager != null && !_sessionManager.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (getResponse().isCommitted())
    throw new IllegalStateException("Response is committed");
  if (_sessionManager == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionManager.newHttpSession(this);
  HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _channel.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: jenkinsci/winstone

@Override
public HttpSession getSession(boolean create)
{
  if (_session != null)
  {
    if (_sessionHandler != null && !_sessionHandler.isValid(_session))
      _session = null;
    else
      return _session;
  }
  if (!create)
    return null;
  if (getResponse().isCommitted())
    throw new IllegalStateException("Response is committed");
  if (_sessionHandler == null)
    throw new IllegalStateException("No SessionManager");
  _session = _sessionHandler.newHttpSession(this);
  HttpCookie cookie = _sessionHandler.getSessionCookie(_session,getContextPath(),isSecure());
  if (cookie != null)
    _channel.getResponse().addCookie(cookie);
  return _session;
}

代码示例来源:origin: jenkinsci/winstone

@Override
public String changeSessionId()
{
  HttpSession session = getSession(false);
  if (session == null)
    throw new IllegalStateException("No session");
  if (session instanceof Session)
  {
    Session s =  ((Session)session);
    s.renewId(this);
    if (getRemoteUser() != null)
      s.setAttribute(Session.SESSION_CREATED_SECURE, Boolean.TRUE);
    if (s.isIdChanged() && _sessionHandler.isUsingCookies())
      _channel.getResponse().addCookie(_sessionHandler.getSessionCookie(s, getContextPath(), isSecure()));
  }
  return session.getId();
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

r.setAttribute(AsyncContext.ASYNC_CONTEXT_PATH,r.getContextPath());
r.setAttribute(AsyncContext.ASYNC_SERVLET_PATH,r.getServletPath());
r.setAttribute(AsyncContext.ASYNC_PATH_INFO,r.getPathInfo());

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

r.setAttribute(AsyncContext.ASYNC_CONTEXT_PATH,r.getContextPath());
r.setAttribute(AsyncContext.ASYNC_SERVLET_PATH,r.getServletPath());
r.setAttribute(AsyncContext.ASYNC_PATH_INFO,r.getPathInfo());

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

r.setAttribute(AsyncContext.ASYNC_CONTEXT_PATH,r.getContextPath());
r.setAttribute(AsyncContext.ASYNC_SERVLET_PATH,r.getServletPath());
r.setAttribute(AsyncContext.ASYNC_PATH_INFO,r.getPathInfo());

代码示例来源:origin: org.eclipse.jetty/server

r.setAttribute(AsyncContext.ASYNC_CONTEXT_PATH,r.getContextPath());
r.setAttribute(AsyncContext.ASYNC_SERVLET_PATH,r.getServletPath());
r.setAttribute(AsyncContext.ASYNC_PATH_INFO,r.getPathInfo());

相关文章

微信公众号

最新文章

更多

Request类方法