org.simpleframework.http.Request.getCookie()方法的使用及代码示例

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

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

Request.getCookie介绍

暂无

代码示例

代码示例来源:origin: org.simpleframework/simple-http

  1. /**
  2. * This is used to acquire a cookie usiing the name of that cookie.
  3. * If the cookie exists within the HTTP header then it is returned
  4. * as a <code>Cookie</code> object. Otherwise this method will
  5. * return null. Each cookie object will contain the name, value
  6. * and path of the cookie as well as the optional domain part.
  7. *
  8. * @param name this is the name of the cookie object to acquire
  9. *
  10. * @return this returns a cookie object from the header or null
  11. */
  12. public Cookie getCookie(String name) {
  13. return request.getCookie(name);
  14. }

代码示例来源:origin: ngallagher/simpleframework

  1. /**
  2. * This is used to acquire a cookie usiing the name of that cookie.
  3. * If the cookie exists within the HTTP header then it is returned
  4. * as a <code>Cookie</code> object. Otherwise this method will
  5. * return null. Each cookie object will contain the name, value
  6. * and path of the cookie as well as the optional domain part.
  7. *
  8. * @param name this is the name of the cookie object to acquire
  9. *
  10. * @return this returns a cookie object from the header or null
  11. */
  12. public Cookie getCookie(String name) {
  13. return request.getCookie(name);
  14. }

代码示例来源:origin: org.simpleframework/simple

  1. /**
  2. * This is used to acquire a cookie usiing the name of that cookie.
  3. * If the cookie exists within the HTTP header then it is returned
  4. * as a <code>Cookie</code> object. Otherwise this method will
  5. * return null. Each cookie object will contain the name, value
  6. * and path of the cookie as well as the optional domain part.
  7. *
  8. * @param name this is the name of the cookie object to acquire
  9. *
  10. * @return this returns a cookie object from the header or null
  11. */
  12. public Cookie getCookie(String name) {
  13. return request.getCookie(name);
  14. }

代码示例来源:origin: CodeStory/fluent-http

  1. @Override
  2. public String value(String name) {
  3. org.simpleframework.http.Cookie cookie = request.getCookie(name);
  4. return (cookie == null) ? null : cookie.getValue();
  5. }

代码示例来源:origin: CodeStory/fluent-http

  1. @Override
  2. public SimpleCookie get(String name) {
  3. org.simpleframework.http.Cookie cookie = request.getCookie(name);
  4. return (cookie == null) ? null : new SimpleCookie(cookie);
  5. }

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

  1. @Override
  2. public boolean isPersistentCookie(String cookie) {
  3. Map<String, String> cookiesMap = getCookiesMap();
  4. return cookiesMap.containsKey(cookie) ? request.getCookie(cookie).getExpiry() > 0 : false;
  5. }

代码示例来源:origin: lantunes/fixd

  1. public Session getSessionIfExists(Request request) {
  2. Cookie cookie = request.getCookie(SESSION_COOKIE_NAME);
  3. if (cookie != null) {
  4. String sessionId = cookie.getValue();
  5. Session session = sessions.get(sessionId);
  6. if (session != null && !session.isValid()) {
  7. sessions.remove(sessionId);
  8. return null;
  9. }
  10. return session;
  11. }
  12. return null;
  13. }

代码示例来源:origin: io.restx/restx-server-simple

  1. @Override
  2. public boolean isPersistentCookie(String cookie) {
  3. Map<String, String> cookiesMap = getCookiesMap();
  4. return cookiesMap.containsKey(cookie) ? request.getCookie(cookie).getExpiry() > 0 : false;
  5. }

相关文章