public class SessionData
extends java.lang.Object
It has to be used from inside an OpenXava request, though you can use it in any part
of your application: JSPs, actions, calculators, validators, entities, etc.
If you want use it inside your own servlet you have to call first to SessionData.setCurrent(request),
and SessionData.clean() at end.
An advantage of using this class over direct request.getSession() is that it abstracts your code
from web technology, so that code could work in other contexts, as Swing for example.
Constructor and Description |
---|
SessionData() |
Modifier and Type | Method and Description |
---|---|
static void |
clean()
If you use SessionData in your own servlet call to this method at end.
|
static java.lang.Object |
get(java.lang.String key)
If not session available returns null.
|
static void |
put(java.lang.String key,
java.lang.Object value) |
static void |
remove(java.lang.String key) |
static void |
setCurrent(HttpServletRequest request)
To use SessionData in your own servlet first call to this method.
|
public static void setCurrent(HttpServletRequest request)
public static void clean()
public static java.lang.Object get(java.lang.String key)
public static void put(java.lang.String key, java.lang.Object value)
java.lang.IllegalStateException
- If not session available.public static void remove(java.lang.String key)
java.lang.IllegalStateException
- If not session available.