org.blojsom.util
Class CookieUtils

java.lang.Object
  extended byorg.blojsom.util.CookieUtils

public class CookieUtils
extends java.lang.Object

CookieUtils

Since:
blojsom 3.0
Version:
$Id: CookieUtils.java,v 1.4 2007/01/17 02:35:18 czarneckid Exp $
Author:
David Czarnecki

Constructor Summary
CookieUtils()
           
 
Method Summary
static void addCookie(javax.servlet.http.HttpServletResponse httpServletResponse, int cookieExpiration, java.lang.String cookieKey, java.lang.String cookieValue)
          Add a cookie with a key and value to the response
static javax.servlet.http.Cookie getCookie(javax.servlet.http.HttpServletRequest httpServletRequest, java.lang.String cookieKey)
          Return a cookie given a particular key
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CookieUtils

public CookieUtils()
Method Detail

getCookie

public static javax.servlet.http.Cookie getCookie(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                  java.lang.String cookieKey)
Return a cookie given a particular key

Parameters:
httpServletRequest - Request
cookieKey - Cookie key
Returns:
Cookie of the requested key or null if no cookie under that name is found

addCookie

public static void addCookie(javax.servlet.http.HttpServletResponse httpServletResponse,
                             int cookieExpiration,
                             java.lang.String cookieKey,
                             java.lang.String cookieValue)
Add a cookie with a key and value to the response

Parameters:
httpServletResponse - Response
cookieExpiration - Cookie expiration (in seconds)
cookieKey - Cookie key
cookieValue - Cookie value