The user session expires after a certain
period of inactivity, usually defined in the Web deployment
descriptor.
JViews objects are stored in the HTTP user
session. For example, after the user session expiration, queries to
update the image will fail.
The
beforeSessionExpirationHandler
property allows you to add a JavaScriptâ„¢ handler that will be
invoked when the user session is about to expire.
For example, to keep the session alive as
long as the browser page is open, use the following code:
<jvtf:equipmentView [...]
beforeSessionExpirationHandler="view.updateImage();" />
This example shows how to query an image and
keep the user session alive.
Note the use of
view
, the implicit object that represents the view JavaScript proxy.
The internal timer is reset only by requests issued by JViews
objects. If the application implements other requests that do not
refresh the image, this timer could be inaccurate. To reset the
timer manually, use the following JavaScript code:
viewID.getObject().resetSessionExpirationTimer();
where
viewID
is the value of the
id
property of your view component.
Note
The
beforeSessionExpirationHandler
is called two minutes before the actual session expiration time.