|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Field Summary | |
static int |
AGE_DELETE
|
static int |
AGE_SESSION
|
Fields inherited from interface org.apache.turbine.util.parser.ValueParser |
URL_CASE_FOLDING, URL_CASE_FOLDING_LOWER, URL_CASE_FOLDING_NONE, URL_CASE_FOLDING_UPPER |
Method Summary | |
URI |
getCookiePath()
Get the Path where cookies will be stored |
javax.servlet.http.HttpServletRequest |
getRequest()
Gets the Request Object for this parser. |
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(URI path)
Set the path for cookie storage |
void |
setData(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Sets Request and Response to be parsed. |
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. |
Field Detail |
public static final int AGE_SESSION
public static final int AGE_DELETE
Method Detail |
public RunData getRunData()
public javax.servlet.http.HttpServletRequest getRequest()
public void setRunData(RunData data)
data
- the RunData object.public void setData(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
request
- The http request from the servletresponse
- The http reponse from the servletpublic URI getCookiePath()
public void setCookiePath(URI path)
public void set(java.lang.String name, java.lang.String value)
public void set(java.lang.String name, java.lang.String value, int seconds_age)
public void unset(java.lang.String name)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |