|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ScriptSession
Script scope is like session scope except that it is managed using a Javascript variable. The operations on a Page are similar to (and derived from) the options on a Session, with some added simplification.
javax.servlet.http.HttpSession
Method Summary | |
---|---|
void |
addScript(ScriptBuffer script)
Add a script to the list waiting for remote execution. |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the object bound with the specified name in this session, or null if no object is bound under the name. |
java.util.Iterator |
getAttributeNames()
Returns an Enumeration of String objects
containing the names of all the objects bound to this session. |
long |
getCreationTime()
Returns the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT. |
java.lang.String |
getId()
Returns a string containing the unique identifier assigned to this session. |
long |
getLastAccessedTime()
Returns the last time the client sent a request associated with this session, as the number of milliseconds since 1/1/1970 GMT, and marked by the time the container received the request. |
void |
invalidate()
Invalidates this session then unbinds any objects bound to it. |
boolean |
isInvalidated()
Checks to see if this ScriptSession has been invalidated. |
void |
removeAttribute(java.lang.String name)
Removes the object bound with the specified name from this session. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Binds an object to this session, using the name specified. |
Method Detail |
---|
java.lang.Object getAttribute(java.lang.String name)
null
if no object is bound under the name.
name
- a string specifying the name of the object
java.lang.IllegalStateException
- if the page has been invalidatedvoid setAttribute(java.lang.String name, java.lang.Object value)
name
- the name to which the object is bound; cannot be nullvalue
- the object to be bound
java.lang.IllegalStateException
- if the page has been invalidatedvoid removeAttribute(java.lang.String name)
name
- the name of the object to remove from this session
java.lang.IllegalStateException
- if the page has been invalidatedjava.util.Iterator getAttributeNames()
Enumeration
of String
objects
containing the names of all the objects bound to this session.
Iterator
of String
s, specifying the
names of all the objects bound to this session
java.lang.IllegalStateException
- if the page has been invalidatedvoid invalidate()
java.lang.IllegalStateException
- if the page has been invalidatedboolean isInvalidated()
There is no similar method on HttpSession
because it is
assumed that you do not store HttpSessions from one request to another,
so all sessions that you have access to will always be either valid, or
you have just invalidated it yourself so you wont need to ask. This
method makes up for the change that now ScriptSessions are accessible
from outside the normal scope.
void addScript(ScriptBuffer script)
script
- The script to executejava.lang.String getId()
java.lang.IllegalStateException
- if the page has been invalidatedlong getCreationTime()
java.lang.IllegalStateException
- if the page has been invalidatedlong getLastAccessedTime()
Actions that your application takes, such as getting or setting a value associated with the session, do not affect the access time.
java.lang.IllegalStateException
- if the page has been invalidated
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |