Package org.apache.fulcrum.parser
Klasse DefaultCookieParser
java.lang.Object
org.apache.fulcrum.parser.BaseValueParser
org.apache.fulcrum.parser.DefaultCookieParser
- Alle implementierten Schnittstellen:
Iterable<String>
,org.apache.avalon.framework.logger.LogEnabled
,CookieParser
,ParserServiceSupport
,ValueParser
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.
- Version:
- $Id$
- Autor:
- Ilkka Priha, Leon Messerschmidt, Thomas Vandahl
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen org.apache.fulcrum.parser.ValueParser
ValueParser.URLCaseFolding
-
Feldübersicht
Von Klasse geerbte Felder org.apache.fulcrum.parser.BaseValueParser
parameters, parserService
Von Schnittstelle geerbte Felder org.apache.fulcrum.parser.CookieParser
AGE_DELETE, AGE_SESSION
Von Schnittstelle geerbte Felder org.apache.fulcrum.parser.ValueParser
DEFAULT_CHARACTER_ENCODING
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
dispose()
Disposes the parser.Gets the servlet request.boolean
isValid()
void
Set a cookie that will be stored on the client for the duration of the session.void
Set a persistent cookie on the client that will expire after a maximum age (given in seconds).void
setData
(HttpServletRequest request, HttpServletResponse response) Sets the servlet request and response to be parsed.void
Remove a previously set cookie from the client machine.Von Klasse geerbte Methoden org.apache.fulcrum.parser.BaseValueParser
add, add, add, add, add, add, clear, containsKey, convert, convertAndTrim, convertAndTrim, enableLogging, 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, getLogger, getLong, getLong, getLongObject, getLongObject, getLongObjects, getLongs, getNumberFormat, getObject, getObjects, getParam, getString, getString, getStrings, getStrings, getToStringParam, getUrlFolding, isDisposed, iterator, keySet, putParam, recycle, recycle, remove, setCharacterEncoding, setDateFormat, setLocale, setNumberFormat, setParserService, setProperties, setProperty, setString, setStrings, toString
Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden java.lang.Iterable
forEach, iterator, spliterator
Von Schnittstelle geerbte Methoden org.apache.fulcrum.parser.ValueParser
add, add, add, add, add, add, clear, containsKey, convert, convertAndTrim, convertAndTrim, 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
-
Konstruktordetails
-
DefaultCookieParser
public DefaultCookieParser()Constructs a new CookieParser.
-
-
Methodendetails
-
dispose
public void dispose()Disposes the parser.- Angegeben von:
dispose
in SchnittstelleValueParser
- Setzt außer Kraft:
dispose
in KlasseBaseValueParser
-
getRequest
Gets the servlet request.- Angegeben von:
getRequest
in SchnittstelleCookieParser
- Gibt zurück:
- the servlet request object or null.
-
setData
Sets the servlet request and response to be parsed. All previous cookies will be cleared.- Angegeben von:
setData
in SchnittstelleCookieParser
- Parameter:
request
- the servlet request object.response
- the servlet response object
-
set
Set a cookie that will be stored on the client for the duration of the session.- Angegeben von:
set
in SchnittstelleCookieParser
- Parameter:
name
- The name of the cookievalue
- The value of the cooking
-
set
Beschreibung aus Schnittstelle kopiert:CookieParser
Set a persistent cookie on the client that will expire after a maximum age (given in seconds).- Angegeben von:
set
in SchnittstelleCookieParser
- Parameter:
name
- A String for the namevalue
- A String for the valuesecondsAge
- An int for the age in seconds
-
unset
Beschreibung aus Schnittstelle kopiert:CookieParser
Remove a previously set cookie from the client machine.- Angegeben von:
unset
in SchnittstelleCookieParser
- Parameter:
name
- the name of the cooking to unset
-
isValid
public boolean isValid()- Angegeben von:
isValid
in SchnittstelleCookieParser
- Setzt außer Kraft:
isValid
in KlasseBaseValueParser
-