ICEpush JSP IntegrationICEpush JSP integration includes 2 main elements:
JSP Tags<icep:register>The register tag creates a unique pushID and registers a JavaScript callback with it. It optionally declares a group that the pushID belongs to, and a notifier bean responsible for triggering notifications. <icep:register callback="myScript" group="myGroup", notifier="myNotifier"/>
<icep:region>The region tag creates a unique pushID and associates it with a specific included page. The dynamic page content is included initially when the page loads, and is reloaded using an ajax GET when notifications occur to the pushID. The group name is included as a parameter to the GET request, so it is available to the included page. It optionally declares a <div> id for the updated region, a group that the pushID belongs to, and a notifier bean responsible for triggering notifications. <icep:region id="myID" group="myGroup", notifier="myNotifier" page="/mypage.jsp"/>
<icep:push>The push tag causes a push notification to occur to the named group, on when the page loads.
<icep:push group="myGroup"/>
<icep:pushPeriodic>The pushPeriodic tag causes a period push notification to occur to the named group, on a specified time interval. The precise behavior of the push timing is governed by the implementation of java.util.timer. <icep:pushPeriodic group="myGroup" interval="5000" />
Inclusion of the pushPeriodic tag requires the following additional configuration in the web.xml. <listener> <listener-class> org.icepush.integration.jsp.core.GroupIntervalTimer </listener-class> </listener> NotificationFor notifications to occur, the notification business logic must have a valid PushContext to use. While in a normal or ajax-based request/response cycle the PushContext is readily available using the ServletContext. PushContext pushContext = PushContext.getInstance(myServletContext); If, however, notification triggers are to occur outside a request/response cycle, the notifying thread of execution still needs a valid PushContext to use. A common Notifier bean is provided that maintains a reference to the PushContext, and is initialized at page load time using the notifier attribute provided in the ICEpush JSP tag library. NotifierA Notifier is any POJO that extends the base class Notifier. The base class simply holds a reference to a valid PushContext, and provides the following API. public void setPushContext(PushContext pc); public PushContext getPushContext(); public void push(String group) Group NotifierGroupNotifier extends Notifier and simply maintains the group attribute associated with the tag. It provides the following additional API: public void setGroup(String group); public String getGroup(); public void push(); Group NamingGroup naming employees application-specific strategies. While group naming is orthogonal to JSP bean scopes, they can effectively be associated with a scope.
|
ICEpush JSP Integration Details
© Copyright 2016 ICEsoft Technologies Canada Corp.