shared
Class CookieUtil

java.lang.Object
  extended by shared.CookieUtil

public class CookieUtil
extends java.lang.Object

A utility class to find cookies by name and return either the cookie or the value of the cookie.


Constructor Summary
CookieUtil()
           
 
Method Summary
static javax.servlet.http.Cookie findCookie(javax.servlet.http.HttpServletRequest request, java.lang.String name)
          Search for a cookie with the given name.
static java.lang.String findCookieValue(javax.servlet.http.HttpServletRequest request, java.lang.String name)
          Search for a cookie with the given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CookieUtil

public CookieUtil()
Method Detail

findCookie

public static javax.servlet.http.Cookie findCookie(javax.servlet.http.HttpServletRequest request,
                                                   java.lang.String name)
Search for a cookie with the given name. Return the cookie.

Parameters:
request - Request information encapsulated in a Java object
name - The name of the cookie to find
Returns:
The cookie, if found; null if not found.

findCookieValue

public static java.lang.String findCookieValue(javax.servlet.http.HttpServletRequest request,
                                               java.lang.String name)
Search for a cookie with the given name. Return the value.

Parameters:
request - Request information encapsulated in a Java object
name - The name of the cookie to find
Returns:
The value of the cookie, if found; null if not found