org.apache.coyote.Request.getCookies()方法的使用及代码示例

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

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

Request.getCookies介绍

暂无

代码示例

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

  1. /**
  2. * Return the server representation of the cookies associated with this
  3. * request. Triggers parsing of the Cookie HTTP headers (but not conversion
  4. * to Cookie objects) if the headers have not yet been parsed.
  5. *
  6. * @return the server cookies
  7. */
  8. public ServerCookies getServerCookies() {
  9. parseCookies();
  10. return coyoteRequest.getCookies();
  11. }

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

  1. /**
  2. * Return the server representation of the cookies associated with this
  3. * request. Triggers parsing of the Cookie HTTP headers (but not conversion
  4. * to Cookie objects) if the headers have not yet been parsed.
  5. *
  6. * @return the server cookies
  7. */
  8. public ServerCookies getServerCookies() {
  9. parseCookies();
  10. return coyoteRequest.getCookies();
  11. }

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

  1. protected void recycleCookieInfo(boolean recycleCoyote) {
  2. cookiesParsed = false;
  3. cookiesConverted = false;
  4. cookies = null;
  5. if (recycleCoyote) {
  6. getCoyoteRequest().getCookies().recycle();
  7. }
  8. }

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

  1. protected void recycleCookieInfo(boolean recycleCoyote) {
  2. cookiesParsed = false;
  3. cookiesConverted = false;
  4. cookies = null;
  5. if (recycleCoyote) {
  6. getCoyoteRequest().getCookies().recycle();
  7. }
  8. }

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

  1. /**
  2. * Parse cookies. This only parses the cookies into the memory efficient
  3. * ServerCookies structure. It does not populate the Cookie objects.
  4. */
  5. protected void parseCookies() {
  6. if (cookiesParsed) {
  7. return;
  8. }
  9. cookiesParsed = true;
  10. ServerCookies serverCookies = coyoteRequest.getCookies();
  11. serverCookies.setLimit(connector.getMaxCookieCount());
  12. CookieProcessor cookieProcessor = getContext().getCookieProcessor();
  13. cookieProcessor.parseCookieHeader(coyoteRequest.getMimeHeaders(), serverCookies);
  14. }

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

  1. /**
  2. * Parse cookies. This only parses the cookies into the memory efficient
  3. * ServerCookies structure. It does not populate the Cookie objects.
  4. */
  5. protected void parseCookies() {
  6. if (cookiesParsed) {
  7. return;
  8. }
  9. cookiesParsed = true;
  10. ServerCookies serverCookies = coyoteRequest.getCookies();
  11. serverCookies.setLimit(connector.getMaxCookieCount());
  12. CookieProcessor cookieProcessor = getContext().getCookieProcessor();
  13. cookieProcessor.parseCookieHeader(coyoteRequest.getMimeHeaders(), serverCookies);
  14. }

代码示例来源:origin: org.osivia.portal.core/osivia-portal-jbossas-jbossweb-lib

  1. /* 2361 */ Cookies serverCookies = this.coyoteRequest.getCookies();
  2. /* 2362 */ int count = serverCookies.getCookieCount();
  3. /* 2363 */ if (count <= 0) {

代码示例来源:origin: tomcat/catalina

  1. Cookies serverCookies = coyoteRequest.getCookies();
  2. int count = serverCookies.getCookieCount();
  3. if (count <= 0)

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

  1. Cookies serverCookies = coyoteRequest.getCookies();
  2. int count = serverCookies.getCookieCount();
  3. if (count <= 0)

代码示例来源:origin: jboss.web/jbossweb

  1. Cookies serverCookies = coyoteRequest.getCookies();
  2. int count = serverCookies.getCookieCount();
  3. if (count <= 0)

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

  1. Cookies serverCookies = coyoteRequest.getCookies();
  2. int count = serverCookies.getCookieCount();
  3. if (count <= 0)

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

  1. Cookies serverCookies = coyoteRequest.getCookies();
  2. int count = serverCookies.getCookieCount();
  3. if (count <= 0)

代码示例来源:origin: codefollower/Tomcat-Research

  1. Cookies serverCookies = coyoteRequest.getCookies();
  2. int count = serverCookies.getCookieCount();
  3. if (count <= 0) {

代码示例来源:origin: org.jboss.web/jbossweb

  1. Cookies serverCookies = coyoteRequest.getCookies();
  2. int count = serverCookies.getCookieCount();
  3. if (count <= 0)

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

  1. Cookies serverCookies = coyoteRequest.getCookies();
  2. int count = serverCookies.getCookieCount();
  3. if (count <= 0) {

代码示例来源:origin: org.osivia.portal.core/osivia-portal-jbossas-jbossweb-lib

  1. /* */ protected void parseSessionCookiesId(org.apache.coyote.Request req, Request request)
  2. /* 527 */ Cookies serverCookies = req.getCookies();
  3. /* 528 */ int count = serverCookies.getCookieCount();
  4. /* 529 */ if (count <= 0) {

代码示例来源:origin: tomcat/catalina

  1. Cookies serverCookies = req.getCookies();
  2. int count = serverCookies.getCookieCount();
  3. if (count <= 0)

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

  1. ServerCookies serverCookies = coyoteRequest.getCookies();
  2. CookieProcessor cookieProcessor = getContext().getCookieProcessor();

代码示例来源:origin: jboss.web/jbossweb

  1. /**
  2. * Parse session id in URL.
  3. */
  4. protected void parseSessionCookiesId(org.apache.coyote.Request req, Request request) {
  5. // Parse session id from cookies
  6. Cookies serverCookies = req.getCookies();
  7. int count = serverCookies.getCookieCount();
  8. if (count <= 0)
  9. return;
  10. for (int i = 0; i < count; i++) {
  11. ServerCookie scookie = serverCookies.getCookie(i);
  12. if (scookie.getName().equals(Globals.SESSION_COOKIE_NAME)) {
  13. // Override anything requested in the URL
  14. if (!request.isRequestedSessionIdFromCookie()) {
  15. // Accept only the first session id cookie
  16. convertMB(scookie.getValue());
  17. request.setRequestedSessionId(scookie.getValue().toString());
  18. request.setRequestedSessionCookie(true);
  19. request.setRequestedSessionURL(false);
  20. } else {
  21. if (!isSessionIdValid(request, request.getRequestedSessionId())) {
  22. // Replace the session id until one is valid
  23. convertMB(scookie.getValue());
  24. request.setRequestedSessionId(scookie.getValue().toString());
  25. }
  26. }
  27. }
  28. }
  29. }

代码示例来源:origin: org.jboss.web/jbossweb

  1. /**
  2. * Parse session id in URL.
  3. */
  4. protected void parseSessionCookiesId(org.apache.coyote.Request req, Request request) {
  5. // Parse session id from cookies
  6. Cookies serverCookies = req.getCookies();
  7. int count = serverCookies.getCookieCount();
  8. if (count <= 0)
  9. return;
  10. String cookieName = request.getContext().getSessionCookie().getName();
  11. for (int i = 0; i < count; i++) {
  12. ServerCookie scookie = serverCookies.getCookie(i);
  13. if (scookie.getName().equals(cookieName)) {
  14. // Override anything requested in the URL
  15. if (!request.isRequestedSessionIdFromCookie()) {
  16. // Accept only the first session id cookie
  17. convertMB(scookie.getValue());
  18. request.setRequestedSessionId(scookie.getValue().toString());
  19. request.setRequestedSessionCookie(true);
  20. request.setRequestedSessionURL(false);
  21. } else {
  22. if (!isSessionIdValid(request, request.getRequestedSessionId())) {
  23. // Replace the session id until one is valid
  24. convertMB(scookie.getValue());
  25. request.setRequestedSessionId(scookie.getValue().toString());
  26. }
  27. }
  28. }
  29. }
  30. }

相关文章

Request类方法