|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.iplanet.jato.model.SessionModel
Provides a model implementation backed by the HTTP session. This model can be used to automatically bind display fields to the current request's session attributes. The bound name of display fields must correspond exactly to the name of the desired value in the session's attributes. Note that use of this model will cause the session to be created if it does not already exist.
HttpSession
Constructor Summary | |
SessionModel()
This constructor is used when the model is created by the ModelManager. |
|
SessionModel(javax.servlet.http.HttpSession session)
This constructor can be used when creating a SessionModel directly |
Method Summary | |
java.lang.String |
getName()
Returns the logical instance name of this model. |
java.lang.Object |
getValue(java.lang.String name)
Returns the value contained in the named session attribute |
java.lang.Object[] |
getValues(java.lang.String name)
Returns the value contained in the named session attribute wrapped in an Object array |
void |
setName(java.lang.String value)
Sets the logical name of this model |
void |
setRequestContext(RequestContext value)
Sets the RequestContext used to obtain the
HttpSession . |
void |
setValue(java.lang.String name,
java.lang.Object value)
Sets the provided value in the session attribute under the specified name. |
void |
setValues(java.lang.String name,
java.lang.Object[] value)
Sets the provided value in the session attribute under the specified name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SessionModel()
setRequestContext(...)
(this method is automatically called by the model manager before returning
the model).public SessionModel(javax.servlet.http.HttpSession session)
session
- The session for the current requestjava.lang.IllegalArgumentException
- Thrown if the session
parameter is nullMethod Detail |
public java.lang.String getName()
Model
ModelManager
may assign a name to a model based
on user request.getName
in interface Model
com.iplanet.jato.model.Model
public void setName(java.lang.String value)
Model
setName
in interface Model
com.iplanet.jato.model.Model
name
- The new name of this modelpublic void setRequestContext(RequestContext value)
RequestContext
used to obtain the
HttpSession
. This method will create the session if
it has not already been created.setRequestContext
in interface RequestParticipant
value
- The request context object for the current requestpublic java.lang.Object getValue(java.lang.String name)
getValue
in interface Model
name
- The name of the session attribute that will be returnedpublic void setValue(java.lang.String name, java.lang.Object value)
setValue(...)
method. If the value parameter
is null, the named session attribute will be removed from the session.setValue
in interface Model
name
- The name of the session attribute to set. If this method
is called autmaticaly by a bound display field, the provided
name will be the display field's bound field name.value
- The value of the session attribute to set. If null, the
named attribute will be removed from the session.public java.lang.Object[] getValues(java.lang.String name)
getValues
in interface Model
name
- The name of the session attribute that will be returnedpublic void setValues(java.lang.String name, java.lang.Object[] value)
setValues(...)
method. If the value parameter
is null or of length zero, the named session attribute will be removed
from the session.setValues
in interface Model
name
- The name of the session attribute to set. If this method
is called autmaticaly by a bound display field, the provided
name will be the display field's bound field name.value
- The value of the session attribute to set. Only the first
element of the provided array will be set as the session
attribute. If null or of length zero, the named attribute
will be removed from the session.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |