32.4. <ajax:conversationActivator>

ConversationActivator是一个会话激活器,OperaMasks 3.0开始提供一个ConversationContext,该ConversationContext用于保存会话过程用户需要保存的数据,使ManagedBean可以工作在REQUEST范围下,因为ConversationContext有超时时间,如果某一页面希望在超时时间后继续维持ConversationContext,则使用此激活器,设定激活时长,使会话得以延长。如果ManagedBean生命周期是SESSION或APPLICATION的话则没有必要使用此构件。

32.4.1. 构件信息

表 32.6. 构件信息

Component Typeorg.operamasks.faces.component.ajax.AjaxConversationActivator
Component Familyorg.operamasks.faces.component.ajax.AjaxConversationActivator
Component Classorg.operamasks.faces.component.ajax.AjaxConversationActivator
Tag Classorg.operamasks.faces.webapp.ajax.AjaxConversationActivatorTag
Renderer Typeorg.operamasks.faces.component.ajax.AjaxConversationActivator
Renderer Class(AJAX)org.operamasks.faces.render.ajax.AjaxConversationActivatorRenderer

继承体系

+java.lang.Object

++javax.faces.component.UIComponent

+++javax.faces.component.UIComponentBase

++++org.operamasks.faces.component.ajax.base.AjaxConversationActivatorBase

+++++org.operamasks.faces.component.ajax.AjaxConversationActivator

32.4.2. 属性

表 32.7. 属性

binding 定义类 javax.faces.component.UIComponentBase
类型 javax.el.ValueExpression(javax.faces.component.UIComponent)
是否必须 延时求值
一个值表达式,用于把该组件链接到一个ManagedBean的某个属性。
delay 定义类 org.operamasks.faces.component.ajax.base.AjaxConversationActivatorBase
类型 javax.el.ValueExpression(java.lang.Integer)
是否必须 延时求值
从进入页面开始到会话激活器发出第一次请求时间间隔,单位为秒,默认为50秒
id 定义类 javax.faces.component.UIComponentBase
类型 java.lang.String
是否必须 延时求值
这个组件的组件标识符。这个值在最近的命名容器类型的父组件范围内,必须是唯一的。
period 定义类 org.operamasks.faces.component.ajax.base.AjaxConversationActivatorBase
类型 javax.el.ValueExpression(java.lang.Integer)
是否必须 延时求值
会话激活器两次激活请求时间间隔,单位为秒,默认为50秒
rendered 定义类 javax.faces.component.UIComponentBase
类型 boolean(boolean)
是否必须 延时求值
一个标志,指出该组件是否要在任何随后的form提交过程中被渲染或处理。 这个属性的缺省值是true。
timeout 定义类 org.operamasks.faces.component.ajax.base.AjaxConversationActivatorBase
类型 javax.el.ValueExpression(java.lang.Integer)
是否必须 延时求值
会话激活器的超时时长,单位为秒,默认为30分钟,若timeout设置为-1则默认无限时长,不超时

32.4.3. 构件API

32.4.4. 例子

<ajax:conversationActivator delay="70" period="50" timeout="600"/>

上例中的w:conversationActivator,时延为70秒(在页面渲染完成后70秒时才开始第一次激活),每隔50秒激活一次当前页面的ConversationContext,超时时长为10分钟。