|
||||||||||
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 String |
getKey(FormComponent<?> component)
This method gets used when a cookie key needs to be derived from a form component. |
protected String |
getSaveKey(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 String |
joinValues(String... values)
Join all fragments into one Cookie value |
String |
load(FormComponent<?> formComponent)
Retrieve the cookie value associated with the formComponent and load the model object with the cookie value. |
String |
load(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(String key)
Remove the cookie identified by the key |
void |
save(FormComponent<?> formComponent)
Save the form components model value in a cookie |
void |
save(String key,
String... values)
Create a Cookie with key and value and save it in the browser with the next response |
protected String[] |
splitValue(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(String key)
key
- public final void remove(FormComponent<?> formComponent)
formComponent
- protected String getKey(FormComponent<?> component)
component
-
public final String load(String key)
key
-
public final String load(FormComponent<?> formComponent)
formComponent
-
protected String[] splitValue(String value)
value
-
protected String joinValues(String... values)
values
-
public final void save(String key, String... values)
key
- values
- public final void save(FormComponent<?> formComponent)
formComponent
- protected String getSaveKey(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 |