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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

public Session getSessionIfExists(Request request) {
  
  Cookie cookie = request.getCookie(SESSION_COOKIE_NAME);
  if (cookie != null) {
    String sessionId = cookie.getValue();
    Session session = sessions.get(sessionId);
    if (session != null && !session.isValid()) {
      sessions.remove(sessionId);
      return null;
    }
    return session;
  }
  return null;
}

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

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

相关文章