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

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

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

Request.getContextPath介绍

暂无

代码示例

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

public void sendChallenge(UserRealm realm,
             Request request,
             Response response,
             boolean stale)
  throws IOException
{
  String contextPath=request.getContextPath();
  response.setHeader(HttpHeaders.WWW_AUTHENTICATE,
      "Digest realm=\""+realm.getName()+
      "\", domain=\""+contextPath +
      "\", nonce=\""+newNonce(request)+
      "\", algorithm=MD5, qop=\"auth\"" + (useStale?(" stale="+stale):"")
           );
  
  response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
}

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

public void sendChallenge(UserRealm realm,
             Request request,
             Response response,
             boolean stale)
  throws IOException
{
  String domain=request.getContextPath();
  if (domain==null)
    domain="/";
  response.setHeader(HttpHeaders.WWW_AUTHENTICATE,
      "Digest realm=\""+realm.getName()+
      "\", domain=\""+domain +
      "\", nonce=\""+newNonce(request)+
      "\", algorithm=MD5, qop=\"auth\"" + (useStale?(" stale="+stale):"")
           );
  response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
}

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

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

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

old_context_path=base_request.getContextPath();
old_servlet_path=base_request.getServletPath();
old_path_info=base_request.getPathInfo();

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

if (nuri==null || nuri.length()==0)
  nuri=request.getContextPath();
  if (nuri.length()==0)
    nuri=URIUtil.SLASH;
      response.setContentLength(0);
      response.sendRedirect(response.encodeRedirectURL
               (URIUtil.addPaths(request.getContextPath(),
                      _formErrorPage)));
           "://" + request.getServerName() +
           ":" + request.getServerPort() +
           URIUtil.addPaths(request.getContextPath(),uri));
response.setContentLength(0);
response.sendRedirect(response.encodeRedirectURL(URIUtil.addPaths(request.getContextPath(),
                               _formLoginPage)));

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

if (nuri==null || nuri.length()==0)
  nuri=request.getContextPath();
  if (nuri.length()==0)
    nuri=URIUtil.SLASH;
      response.setContentLength(0);
      response.sendRedirect(response.encodeRedirectURL
               (URIUtil.addPaths(request.getContextPath(),
                      _formErrorPage)));
           "://" + request.getServerName() +
           ":" + request.getServerPort() +
           URIUtil.addPaths(request.getContextPath(),uri));
response.setContentLength(0);
response.sendRedirect(response.encodeRedirectURL(URIUtil.addPaths(request.getContextPath(),
                               _formLoginPage)));

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

String old_context_path=base_request.getContextPath();
String old_servlet_path=base_request.getServletPath();
String old_path_info=base_request.getPathInfo();

相关文章