本文整理汇总了Java中org.craftercms.commons.http.HttpUtils.getCookieValue方法的典型用法代码示例。如果您正苦于以下问题:Java HttpUtils.getCookieValue方法的具体用法?Java HttpUtils.getCookieValue怎么用?Java HttpUtils.getCookieValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.craftercms.commons.http.HttpUtils
的用法示例。
在下文中一共展示了HttpUtils.getCookieValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getProfileLastModifiedCookie
import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
/**
* Returns the last modified timestamp cookie from the request.
*
* @param request the request where to retrieve the last modified timestamp from
*
* @return the last modified timestamp of the authenticated profile
*/
public static Long getProfileLastModifiedCookie(HttpServletRequest request) {
String profileLastModified = HttpUtils.getCookieValue(PROFILE_LAST_MODIFIED_COOKIE_NAME, request);
if (StringUtils.isNotEmpty(profileLastModified)) {
try {
return new Long(profileLastModified);
} catch (NumberFormatException e) {
logger.error("Invalid profile last modified cookie format: {}", profileLastModified);
}
}
return null;
}
示例2: getRememberMeCookie
import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
protected String getRememberMeCookie(HttpServletRequest request) {
return HttpUtils.getCookieValue(REMEMBER_ME_COOKIE_NAME, request);
}
示例3: getTicketCookie
import org.craftercms.commons.http.HttpUtils; //导入方法依赖的package包/类
/**
* Returns the ticket cookie value from the request.
*
* @param request the request where to retrieve the ticket from
*
* @return the ticket
*/
public static String getTicketCookie(HttpServletRequest request) {
return HttpUtils.getCookieValue(TICKET_COOKIE_NAME, request);
}