Package org.apache.fulcrum.parser
Interface CookieParser
- All Superinterfaces:
- Iterable<String>,- ValueParser
- All Known Implementing Classes:
- DefaultCookieParser
CookieParser is an interface to a utility to 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().
 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.- Version:
- $Id$
- Author:
- Ilkka Priha, Leon Messerschmidt, Thomas Vandahl
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.fulcrum.parser.ValueParserValueParser.URLCaseFolding
- 
Field SummaryFieldsFields inherited from interface org.apache.fulcrum.parser.ValueParserDEFAULT_CHARACTER_ENCODING
- 
Method SummaryModifier and TypeMethodDescriptionjakarta.servlet.http.HttpServletRequestGets the servlet request.booleanisValid()voidSet a cookie that will be stored on the client for the duration of the session.voidSet a persistent cookie on the client that will expire after a maximum age (given in seconds).voidsetData(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Sets the servlet request and response to be parsed.voidRemove a previously set cookie from the client machine.Methods inherited from interface java.lang.IterableforEach, iterator, spliteratorMethods inherited from interface org.apache.fulcrum.parser.ValueParseradd, add, add, add, add, add, clear, containsKey, convert, convertAndTrim, convertAndTrim, dispose, get, getBigDecimal, getBigDecimal, getBigDecimals, getBoolean, getBoolean, getBooleanObject, getBooleanObject, getBooleanObjects, getBooleans, getByte, getByte, getByteObject, getByteObject, getBytes, getCharacterEncoding, getDate, getDate, getDate, getDateFormat, getDouble, getDouble, getDoubleObject, getDoubleObject, getDoubleObjects, getDoubles, getFloat, getFloat, getFloatObject, getFloatObject, getFloatObjects, getFloats, getInt, getInt, getIntObject, getIntObject, getIntObjects, getInts, getKeys, getLocale, getLong, getLong, getLongObject, getLongObject, getLongObjects, getLongs, getNumberFormat, getObject, getObjects, getString, getString, getStrings, getStrings, getUrlFolding, keySet, remove, setCharacterEncoding, setDateFormat, setLocale, setNumberFormat, setProperties, setString, setStrings, toString
- 
Field Details- 
AGE_SESSIONstatic final int AGE_SESSION- See Also:
 
- 
AGE_DELETEstatic final int AGE_DELETE- See Also:
 
 
- 
- 
Method Details- 
getRequestjakarta.servlet.http.HttpServletRequest getRequest()Gets the servlet request.- Returns:
- the servlet request object or null.
 
- 
setDatavoid setData(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Sets the servlet request and response to be parsed. All previous cookies will be cleared.- Parameters:
- request- the servlet request object.
- response- the servlet response object
 
- 
setSet a cookie that will be stored on the client for the duration of the session.- Parameters:
- name- The name of the cookie
- value- The value of the cooking
 
- 
setSet a persistent cookie on the client that will expire after a maximum age (given in seconds).- Parameters:
- name- A String for the name
- value- A String for the value
- seconds_age- An int for the age in seconds
 
- 
unsetRemove a previously set cookie from the client machine.- Parameters:
- name- the name of the cooking to unset
 
- 
isValidboolean isValid()
 
-