| org.apache.turbine.util.parser.CookieParser
All known Subclasses: org.apache.turbine.util.parser.DefaultCookieParser,
CookieParser | public interface CookieParser extends ValueParser(Code) | | 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.
author: Ilkka Priha author: Leon Messerschmidt version: $Id: CookieParser.java 534527 2007-05-02 16:10:59Z tv $ |
AGE_DELETE | int AGE_DELETE(Code) | | |
AGE_SESSION | int AGE_SESSION(Code) | | |
getCookiePath | URI getCookiePath()(Code) | | Get the Path where cookies will be stored
|
getRequest | HttpServletRequest getRequest()(Code) | | Gets the Request Object for this parser.
the HttpServletRequest or null. |
getRunData | RunData getRunData()(Code) | | Gets the parsed RunData.
the parsed RunData object or null. Don't use the Run Data object. use getRequest(). |
set | void set(String name, String value)(Code) | | Set a cookie that will be stored on the client for
the duration of the session.
|
set | void set(String name, String value, int seconds_age)(Code) | | Set a persisten cookie on the client that will expire
after a maximum age (given in seconds).
|
setCookiePath | void setCookiePath(URI path)(Code) | | Set the path for cookie storage
|
setData | void setData(HttpServletRequest request, HttpServletResponse response)(Code) | | Sets Request and Response to be parsed.
All previous cookies will be cleared.
Parameters: request - The http request from the servlet Parameters: response - The http reponse from the servlet |
setRunData | void setRunData(RunData data)(Code) | | Sets the RunData to be parsed.
All previous cookies will be cleared.
Parameters: data - the RunData object. Use setData (HttpServletRequest request, HttpServletResponse response) instead |
unset | void unset(String name)(Code) | | Remove a previously set cookie from the client machine.
|
|
|