|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.util.cookies.CookieUtils
public class CookieUtils
Helper class to simplify Cookie handling.
Constructor Summary | |
---|---|
CookieUtils()
Construct. |
|
CookieUtils(CookieDefaults settings)
Construct. |
Method Summary | |
---|---|
protected java.lang.String |
getKey(FormComponent<?> component)
This method gets used when a cookie key needs to be derived from a form component. |
protected java.lang.String |
getSaveKey(java.lang.String key)
Make sure the 'key' does not contain any illegal chars. |
CookieDefaults |
getSettings()
|
protected void |
initializeCookie(javax.servlet.http.Cookie cookie)
Is called before the Cookie is saved. |
protected java.lang.String |
joinValues(java.lang.String... values)
Join all fragments into one Cookie value |
java.lang.String |
load(FormComponent<?> formComponent)
Retrieve the cookie value associated with the formComponent and load the model object with the cookie value. |
java.lang.String |
load(java.lang.String key)
Retrieve the cookie value by means of its key. |
void |
remove(FormComponent<?> formComponent)
Remove the cookie identified by the form component |
void |
remove(java.lang.String key)
Remove the cookie identified by the key |
void |
save(FormComponent<?> formComponent)
Save the form components model value in a cookie |
void |
save(java.lang.String key,
java.lang.String... values)
Create a Cookie with key and value and save it in the browser with the next response |
protected java.lang.String[] |
splitValue(java.lang.String value)
Split the loaded Cookie value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CookieUtils()
public CookieUtils(CookieDefaults settings)
settings
- Method Detail |
---|
public final CookieDefaults getSettings()
public final void remove(java.lang.String key)
key
- public final void remove(FormComponent<?> formComponent)
formComponent
- protected java.lang.String getKey(FormComponent<?> component)
component
-
public final java.lang.String load(java.lang.String key)
key
-
public final java.lang.String load(FormComponent<?> formComponent)
formComponent
-
protected java.lang.String[] splitValue(java.lang.String value)
value
-
protected java.lang.String joinValues(java.lang.String... values)
values
-
public final void save(java.lang.String key, java.lang.String... values)
key
- values
- public final void save(FormComponent<?> formComponent)
formComponent
- protected java.lang.String getSaveKey(java.lang.String key)
key
- The key to be validated
protected void initializeCookie(javax.servlet.http.Cookie cookie)
CookieDefaults
.
cookie
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |