com.ora.jsp.util
Class CookieUtils

java.lang.Object
  |
  +--com.ora.jsp.util.CookieUtils

public class CookieUtils
extends java.lang.Object

This class contains a number of static methods that can be used to work with javax.servlet.Cookie objects.

Version:
1.0
Author:
Hans Bergsten, Gefion software

Constructor Summary
CookieUtils()
           
 
Method Summary
static java.lang.String getCookieValue(java.lang.String name, javax.servlet.http.HttpServletRequest req)
          Returns the value of the Cookie with the specified name, or null of not found.
static boolean isCookieSet(java.lang.String name, javax.servlet.http.HttpServletRequest req)
          Returns true if a cookie with the specified name is present in the request.
static void sendCookie(java.lang.String name, java.lang.String value, int maxAge, javax.servlet.http.HttpServletResponse res)
          Creates a Cookie with the specified name, value and max age, and adds it to the response.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

CookieUtils

public CookieUtils()
Method Detail

getCookieValue

public static java.lang.String getCookieValue(java.lang.String name,
                                              javax.servlet.http.HttpServletRequest req)
Returns the value of the Cookie with the specified name, or null of not found.

sendCookie

public static void sendCookie(java.lang.String name,
                              java.lang.String value,
                              int maxAge,
                              javax.servlet.http.HttpServletResponse res)
Creates a Cookie with the specified name, value and max age, and adds it to the response.

isCookieSet

public static boolean isCookieSet(java.lang.String name,
                                  javax.servlet.http.HttpServletRequest req)
Returns true if a cookie with the specified name is present in the request.