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

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

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

  1. private String getBasePath(final Request request) {
  2. final String contextPath = request.getContextPath();
  3. if (contextPath == null || contextPath.isEmpty()) {
  4. return "/";
  5. } else if (contextPath.charAt(contextPath.length() - 1) != '/') {
  6. return contextPath + "/";
  7. } else {
  8. return contextPath;
  9. }
  10. }

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

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

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

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

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

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

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

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

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

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

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

  1. @Override
  2. public HttpSession getSession(boolean create)
  3. {
  4. if (_session != null)
  5. {
  6. if (_sessionManager != null && !_sessionManager.isValid(_session))
  7. _session = null;
  8. else
  9. return _session;
  10. }
  11. if (!create)
  12. return null;
  13. if (_sessionManager == null)
  14. throw new IllegalStateException("No SessionManager");
  15. _session = _sessionManager.newHttpSession(this);
  16. HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  17. if (cookie != null)
  18. _channel.getResponse().addCookie(cookie);
  19. return _session;
  20. }

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

  1. @Override
  2. public HttpSession getSession(boolean create)
  3. {
  4. if (_session != null)
  5. {
  6. if (_sessionManager != null && !_sessionManager.isValid(_session))
  7. _session = null;
  8. else
  9. return _session;
  10. }
  11. if (!create)
  12. return null;
  13. if (_sessionManager == null)
  14. throw new IllegalStateException("No SessionManager");
  15. _session = _sessionManager.newHttpSession(this);
  16. HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  17. if (cookie != null)
  18. _channel.getResponse().addCookie(cookie);
  19. return _session;
  20. }

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

  1. public String changeSessionId()
  2. {
  3. HttpSession session = getSession(false);
  4. if (session == null)
  5. throw new IllegalStateException("No session");
  6. if (session instanceof AbstractSession)
  7. {
  8. AbstractSession abstractSession = ((AbstractSession)session);
  9. abstractSession.renewId(this);
  10. if (getRemoteUser() != null)
  11. abstractSession.setAttribute(AbstractSession.SESSION_KNOWN_ONLY_TO_AUTHENTICATED, Boolean.TRUE);
  12. if (abstractSession.isIdChanged())
  13. _channel.getResponse().addCookie(_sessionManager.getSessionCookie(abstractSession, getContextPath(), isSecure()));
  14. }
  15. return session.getId();
  16. }

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

  1. public String changeSessionId()
  2. {
  3. HttpSession session = getSession(false);
  4. if (session == null)
  5. throw new IllegalStateException("No session");
  6. if (session instanceof AbstractSession)
  7. {
  8. AbstractSession abstractSession = ((AbstractSession)session);
  9. abstractSession.renewId(this);
  10. if (getRemoteUser() != null)
  11. abstractSession.setAttribute(AbstractSession.SESSION_KNOWN_ONLY_TO_AUTHENTICATED, Boolean.TRUE);
  12. if (abstractSession.isIdChanged())
  13. _channel.getResponse().addCookie(_sessionManager.getSessionCookie(abstractSession, getContextPath(), isSecure()));
  14. }
  15. return session.getId();
  16. }

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

  1. public String changeSessionId()
  2. {
  3. HttpSession session = getSession(false);
  4. if (session == null)
  5. throw new IllegalStateException("No session");
  6. if (session instanceof AbstractSession)
  7. {
  8. AbstractSession abstractSession = ((AbstractSession)session);
  9. abstractSession.renewId(this);
  10. if (getRemoteUser() != null)
  11. abstractSession.setAttribute(AbstractSession.SESSION_CREATED_SECURE, Boolean.TRUE);
  12. if (abstractSession.isIdChanged())
  13. _channel.getResponse().addCookie(_sessionManager.getSessionCookie(abstractSession, getContextPath(), isSecure()));
  14. }
  15. return session.getId();
  16. }

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

  1. public String changeSessionId()
  2. {
  3. HttpSession session = getSession(false);
  4. if (session == null)
  5. throw new IllegalStateException("No session");
  6. if (session instanceof AbstractSession)
  7. {
  8. AbstractSession abstractSession = ((AbstractSession)session);
  9. abstractSession.renewId(this);
  10. if (getRemoteUser() != null)
  11. abstractSession.setAttribute(AbstractSession.SESSION_KNOWN_ONLY_TO_AUTHENTICATED, Boolean.TRUE);
  12. if (abstractSession.isIdChanged())
  13. _channel.getResponse().addCookie(_sessionManager.getSessionCookie(abstractSession, getContextPath(), isSecure()));
  14. }
  15. return session.getId();
  16. }

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

  1. @Override
  2. public HttpSession getSession(boolean create)
  3. {
  4. if (_session != null)
  5. {
  6. if (_sessionManager != null && !_sessionManager.isValid(_session))
  7. _session = null;
  8. else
  9. return _session;
  10. }
  11. if (!create)
  12. return null;
  13. if (getResponse().isCommitted())
  14. throw new IllegalStateException("Response is committed");
  15. if (_sessionManager == null)
  16. throw new IllegalStateException("No SessionManager");
  17. _session = _sessionManager.newHttpSession(this);
  18. HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  19. if (cookie != null)
  20. _channel.getResponse().addCookie(cookie);
  21. return _session;
  22. }

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

  1. @Override
  2. public HttpSession getSession(boolean create)
  3. {
  4. if (_session != null)
  5. {
  6. if (_sessionManager != null && !_sessionManager.isValid(_session))
  7. _session = null;
  8. else
  9. return _session;
  10. }
  11. if (!create)
  12. return null;
  13. if (getResponse().isCommitted())
  14. throw new IllegalStateException("Response is committed");
  15. if (_sessionManager == null)
  16. throw new IllegalStateException("No SessionManager");
  17. _session = _sessionManager.newHttpSession(this);
  18. HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure());
  19. if (cookie != null)
  20. _channel.getResponse().addCookie(cookie);
  21. return _session;
  22. }

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

  1. @Override
  2. public HttpSession getSession(boolean create)
  3. {
  4. if (_session != null)
  5. {
  6. if (_sessionHandler != null && !_sessionHandler.isValid(_session))
  7. _session = null;
  8. else
  9. return _session;
  10. }
  11. if (!create)
  12. return null;
  13. if (getResponse().isCommitted())
  14. throw new IllegalStateException("Response is committed");
  15. if (_sessionHandler == null)
  16. throw new IllegalStateException("No SessionManager");
  17. _session = _sessionHandler.newHttpSession(this);
  18. HttpCookie cookie = _sessionHandler.getSessionCookie(_session,getContextPath(),isSecure());
  19. if (cookie != null)
  20. _channel.getResponse().addCookie(cookie);
  21. return _session;
  22. }

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

  1. @Override
  2. public String changeSessionId()
  3. {
  4. HttpSession session = getSession(false);
  5. if (session == null)
  6. throw new IllegalStateException("No session");
  7. if (session instanceof Session)
  8. {
  9. Session s = ((Session)session);
  10. s.renewId(this);
  11. if (getRemoteUser() != null)
  12. s.setAttribute(Session.SESSION_CREATED_SECURE, Boolean.TRUE);
  13. if (s.isIdChanged() && _sessionHandler.isUsingCookies())
  14. _channel.getResponse().addCookie(_sessionHandler.getSessionCookie(s, getContextPath(), isSecure()));
  15. }
  16. return session.getId();
  17. }

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

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

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

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

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

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

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

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

相关文章

Request类方法