| org.directwebremoting.ScriptSession
ScriptSession | public interface ScriptSession (Code) | | 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.
See Also: javax.servlet.http.HttpSession author: Joe Walker [joe at getahead dot ltd dot uk] |
Method Summary | |
void | addScript(ScriptBuffer script) Add a script to the list waiting for remote execution. | Object | getAttribute(String name) Returns the object bound with the specified name in this session, or
null if no object is bound under the name. | Iterator<String> | 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. | 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. | String | getPage() What page is this script session attached to?
The page does not include server information, but does include everything
from the host/port onwards, including the query parameters depending on
the configured
org.directwebremoting.extend.PageNormalizer , which
by default removes them. | void | invalidate() Invalidates this session then unbinds any objects bound to it. | boolean | isInvalidated() Checks to see if this ScriptSession has been invalidated.
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. | void | removeAttribute(String name) Removes the object bound with the specified name from this session.
If the session does not have an object bound with the specified name,
this method does nothing.
After this method executes, and if the object implements
HttpSessionBindingListener , the container calls
HttpSessionBindingListener.valueUnbound . | void | setAttribute(String name, Object value) Binds an object to this session, using the name specified.
If an object of the same name is already bound to the session, the
object is replaced.
After this method executes, and if the new object implements
HttpSessionBindingListener , the container calls
HttpSessionBindingListener.valueBound . |
addScript | void addScript(ScriptBuffer script)(Code) | | Add a script to the list waiting for remote execution.
The version automatically wraps the string in a ClientScript object.
Parameters: script - The script to execute |
getAttribute | Object getAttribute(String name)(Code) | | Returns the object bound with the specified name in this session, or
null if no object is bound under the name.
Parameters: name - a string specifying the name of the object the object with the specified name throws: IllegalStateException - if the page has been invalidated |
getAttributeNames | Iterator<String> getAttributeNames()(Code) | | Returns an Enumeration of String objects
containing the names of all the objects bound to this session.
an Iterator of String s, specifying thenames of all the objects bound to this session throws: IllegalStateException - if the page has been invalidated |
getCreationTime | long getCreationTime()(Code) | | Returns the time when this session was created, measured in milliseconds
since midnight January 1, 1970 GMT.
when was this page created, in milliseconds since 1/1/1970 GMT throws: IllegalStateException - if the page has been invalidated |
getId | String getId()(Code) | | Returns a string containing the unique identifier assigned to this
session. The identifier is assigned by the servlet container and is
implementation dependent.
a string specifying the identifier assigned to this session throws: IllegalStateException - if the page has been invalidated |
getLastAccessedTime | long getLastAccessedTime()(Code) | | 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.
Actions that your application takes, such as getting or setting a
value associated with the session, do not affect the access time.
when was this page last accessed, in milliseconds since 1/1/1970 GMT throws: IllegalStateException - if the page has been invalidated |
getPage | String getPage()(Code) | | What page is this script session attached to?
The page does not include server information, but does include everything
from the host/port onwards, including the query parameters depending on
the configured
org.directwebremoting.extend.PageNormalizer , which
by default removes them.
The page that this script session is viewing |
invalidate | void invalidate()(Code) | | Invalidates this session then unbinds any objects bound to it.
throws: IllegalStateException - if the page has been invalidated |
isInvalidated | boolean isInvalidated()(Code) | | Checks to see if this ScriptSession has been invalidated.
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.
true if the ScriptSession has been invalidated |
removeAttribute | void removeAttribute(String name)(Code) | | Removes the object bound with the specified name from this session.
If the session does not have an object bound with the specified name,
this method does nothing.
After this method executes, and if the object implements
HttpSessionBindingListener , the container calls
HttpSessionBindingListener.valueUnbound . The container
then notifies any HttpSessionAttributeListener s in the web
application.
Parameters: name - the name of the object to remove from this session throws: IllegalStateException - if the page has been invalidated |
setAttribute | void setAttribute(String name, Object value)(Code) | | Binds an object to this session, using the name specified.
If an object of the same name is already bound to the session, the
object is replaced.
After this method executes, and if the new object implements
HttpSessionBindingListener , the container calls
HttpSessionBindingListener.valueBound . The container then
notifies any HttpSessionAttributeListener s in the web
application.
If an object was already bound to this session of this name that
implements HttpSessionBindingListener , its
HttpSessionBindingListener.valueUnbound method is called.
If the value passed in is null, this has the same effect as calling
removeAttribute().
Parameters: name - the name to which the object is bound; cannot be null Parameters: value - the object to be bound throws: IllegalStateException - if the page has been invalidated |
|
|