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

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

本文整理了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

  1. public void sendChallenge(UserRealm realm,
  2. Request request,
  3. Response response,
  4. boolean stale)
  5. throws IOException
  6. {
  7. String contextPath=request.getContextPath();
  8. response.setHeader(HttpHeaders.WWW_AUTHENTICATE,
  9. "Digest realm=\""+realm.getName()+
  10. "\", domain=\""+contextPath +
  11. "\", nonce=\""+newNonce(request)+
  12. "\", algorithm=MD5, qop=\"auth\"" + (useStale?(" stale="+stale):"")
  13. );
  14. response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
  15. }

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

  1. public void sendChallenge(UserRealm realm,
  2. Request request,
  3. Response response,
  4. boolean stale)
  5. throws IOException
  6. {
  7. String domain=request.getContextPath();
  8. if (domain==null)
  9. domain="/";
  10. response.setHeader(HttpHeaders.WWW_AUTHENTICATE,
  11. "Digest realm=\""+realm.getName()+
  12. "\", domain=\""+domain +
  13. "\", nonce=\""+newNonce(request)+
  14. "\", algorithm=MD5, qop=\"auth\"" + (useStale?(" stale="+stale):"")
  15. );
  16. response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
  17. }

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

  1. public HttpSession getSession(boolean create)
  2. {
  3. if (_sessionManager==null && create)
  4. throw new IllegalStateException("No SessionHandler or SessionManager");
  5. if (_session != null && _sessionManager!=null && _sessionManager.isValid(_session))
  6. return _session;
  7. _session=null;
  8. String id=getRequestedSessionId();
  9. if (id != null && _sessionManager!=null)
  10. {
  11. _session=_sessionManager.getHttpSession(id);
  12. if (_session == null && !create)
  13. return null;
  14. }
  15. if (_session == null && _sessionManager!=null && create )
  16. {
  17. _session=_sessionManager.newHttpSession(this);
  18. Cookie cookie=_sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  19. if (cookie!=null)
  20. _connection.getResponse().addCookie(cookie);
  21. }
  22. return _session;
  23. }

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

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

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

  1. if (nuri==null || nuri.length()==0)
  2. nuri=request.getContextPath();
  3. if (nuri.length()==0)
  4. nuri=URIUtil.SLASH;
  5. response.setContentLength(0);
  6. response.sendRedirect(response.encodeRedirectURL
  7. (URIUtil.addPaths(request.getContextPath(),
  8. _formErrorPage)));
  9. "://" + request.getServerName() +
  10. ":" + request.getServerPort() +
  11. URIUtil.addPaths(request.getContextPath(),uri));
  12. response.setContentLength(0);
  13. response.sendRedirect(response.encodeRedirectURL(URIUtil.addPaths(request.getContextPath(),
  14. _formLoginPage)));

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

  1. if (nuri==null || nuri.length()==0)
  2. nuri=request.getContextPath();
  3. if (nuri.length()==0)
  4. nuri=URIUtil.SLASH;
  5. response.setContentLength(0);
  6. response.sendRedirect(response.encodeRedirectURL
  7. (URIUtil.addPaths(request.getContextPath(),
  8. _formErrorPage)));
  9. "://" + request.getServerName() +
  10. ":" + request.getServerPort() +
  11. URIUtil.addPaths(request.getContextPath(),uri));
  12. response.setContentLength(0);
  13. response.sendRedirect(response.encodeRedirectURL(URIUtil.addPaths(request.getContextPath(),
  14. _formLoginPage)));

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

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

相关文章