|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.apache.turbine.util.pool.RecyclableSupport
|
+--org.apache.turbine.util.parser.BaseValueParser
|
+--org.apache.turbine.util.parser.DefaultCookieParser
CookieParser is used to get and set values of Cookies on the Client Browser. You can use CookieParser to convert Cookie values to various types or to set Bean values with setParameters(). See the Servlet Spec for more information on Cookies.
Use set() or unset() to Create or Destroy Cookies.
NOTE: The name= portion of a name=value pair may be converted to lowercase or uppercase when the object is initialized and when new data is added. This behaviour is determined by the url.case.folding property in TurbineResources.properties. Adding a name/value pair may overwrite existing name=value pairs if the names match:
CookieParser cp = data.getCookies();
cp.add("ERROR",1);
cp.add("eRrOr",2);
int result = cp.getInt("ERROR");
In the above example, result is 2.
| Field Summary |
| Fields inherited from class org.apache.turbine.util.parser.BaseValueParser |
parameters |
| Fields inherited from interface org.apache.turbine.util.CookieParser |
AGE_DELETE, AGE_SESSION |
| Fields inherited from interface org.apache.turbine.util.ValueParser |
URL_CASE_FOLDING, URL_CASE_FOLDING_LOWER, URL_CASE_FOLDING_NONE, URL_CASE_FOLDING_UPPER |
| Constructor Summary | |
DefaultCookieParser()
Constructs a new CookieParser. |
|
| Method Summary | |
void |
dispose()
Disposes the parser. |
DynamicURI |
getCookiePath()
Get the Path where cookies will be stored |
RunData |
getRunData()
Gets the parsed RunData. |
void |
set(java.lang.String name,
java.lang.String value)
Set a cookie that will be stored on the client for the duration of the session. |
void |
set(java.lang.String name,
java.lang.String value,
int seconds_age)
Set a persisten cookie on the client that will expire after a maximum age (given in seconds). |
void |
setCookiePath(DynamicURI path)
Set the path for cookie storage |
void |
setRunData(RunData data)
Sets the RunData to be parsed. |
void |
unset(java.lang.String name)
Remove a previously set cookie from the client machine. |
| Methods inherited from class org.apache.turbine.util.parser.BaseValueParser |
add, add, add, add, add, append, clear, containsDateSelectorKeys, containsKey, containsTimeSelectorKeys, convert, convertAndTrim, get, getBigDecimal, getBigDecimal, getBigDecimals, getBool, getBool, getBoolean, getBoolean, getByte, getByte, getBytes, getCharacterEncoding, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getInteger, getInteger, getInteger, getIntegers, getInts, getKeys, getLong, getLong, getLongObjects, getLongs, getNumberKey, getObject, getObjects, getString, getString, getStringKey, getStrings, getStrings, keys, recycle, recycle, remove, setCharacterEncoding, setProperties, setProperty, setString, setStrings, toString |
| Methods inherited from class org.apache.turbine.util.pool.RecyclableSupport |
doDispose, isDisposed, Recyclable |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.turbine.util.ValueParser |
add, add, add, add, add, append, clear, containsDateSelectorKeys, containsKey, convert, get, getBigDecimal, getBigDecimal, getBigDecimals, getBool, getBool, getBoolean, getBoolean, getByte, getByte, getBytes, getCharacterEncoding, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getInteger, getInteger, getInteger, getIntegers, getInts, getKeys, getLong, getLong, getLongObjects, getLongs, getNumberKey, getObject, getObjects, getString, getString, getStringKey, getStrings, getStrings, keys, remove, setCharacterEncoding, setProperties, setString, setStrings, toString |
| Methods inherited from interface org.apache.turbine.util.pool.Recyclable |
isDisposed, recycle |
| Constructor Detail |
public DefaultCookieParser()
| Method Detail |
public void dispose()
dispose in interface Recyclabledispose in class BaseValueParserpublic RunData getRunData()
getRunData in interface CookieParserpublic void setRunData(RunData data)
setRunData in interface CookieParserdata - the RunData object.public DynamicURI getCookiePath()
getCookiePath in interface CookieParserpublic void setCookiePath(DynamicURI path)
setCookiePath in interface CookieParser
public void set(java.lang.String name,
java.lang.String value)
set in interface CookieParser
public void set(java.lang.String name,
java.lang.String value,
int seconds_age)
set in interface CookieParserpublic void unset(java.lang.String name)
unset in interface CookieParser
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||