inter-portlet communication ,portlet之间的交互通讯,Transient State Management
来源:互联网 发布:状态模式 java 编辑:程序博客网 时间:2024/06/05 20:04
Transient State Management
JSR-168 portlets have access to two different kinds of transient state:
session state and navigational state.
Session State
Session state is available to the portlet for each user and allows the portlet
to store information needed across multiple user requests.When storing data in the
session one of two sessions scopes can be used: portlet scope or web application
scope.
Attributes stored within the portlet scope are visible only to the portlet
that set them, while attributes set within the web application scope are visible
to all other components within the same web application(servlets,jsps,other portlets,etc.).
At this time, web application-scoped session attributes are the only standard
mechanism by which transient state can be shared by different portlets(
inter-portlet communication). The default scope is portlet scope which will
keep data private to the portlet.
Since the portlet session is essentially a long-lived,in-memory object it is
important that developers be very judicious about what is stored in session.
Data which is appropriate for storing in the portlet session is that which is
user specific and cannot be recreated by any other means.Whenever possibly,
session attributes should be explicitly removed from the session when they
are no longer needed.
At run-time,session state can be accessed via the PortletSession object.
The PortletSession object can be retrieved by calling the getPortletSession()
method in the PortletRequest. Session attributes are represented by name/value
pairs where the name is always a string and the value is any java object.
Navigational State
Navigational state defines how the current view of the portlet is rendered and
is specific to each portlet instance. The navigational state consists of the
portlet mode,window state and any render parameters(render parameters are a
collection of string-based name/value pairs).The navigational state can be read
at any time,but it can be changed only in the processing of an action request
or by clicking on a render link that has specified new navigational state
parameters.
During the processing of an action request,the developer can change the
navigational state via the following methods on the ActionResponse object:
.setPortletMode()
.setRenderParameter()
.setRenderParameters()
.setWindowState()
To change the navigational state via a render link,the renderURL tag can be
used:
<portlet:renderRUL portletMode="edit" windowState="maximized">
<portlet:param name="foo" value="bar">
</portlet:renderURL>
This example creates a render URL that,when clicked by the user,will change
the portlet mode to edit,the window state to maximized and will add a
"foo=bar" render parameter.
It is important to note that the same navigational state will be passed to
the portlet for every render request until it is explicitly changed via
one of the methods described above.
JSR-168 portlets have access to two different kinds of transient state:
session state and navigational state.
Session State
Session state is available to the portlet for each user and allows the portlet
to store information needed across multiple user requests.When storing data in the
session one of two sessions scopes can be used: portlet scope or web application
scope.
Attributes stored within the portlet scope are visible only to the portlet
that set them, while attributes set within the web application scope are visible
to all other components within the same web application(servlets,jsps,other portlets,etc.).
At this time, web application-scoped session attributes are the only standard
mechanism by which transient state can be shared by different portlets(
inter-portlet communication). The default scope is portlet scope which will
keep data private to the portlet.
Since the portlet session is essentially a long-lived,in-memory object it is
important that developers be very judicious about what is stored in session.
Data which is appropriate for storing in the portlet session is that which is
user specific and cannot be recreated by any other means.Whenever possibly,
session attributes should be explicitly removed from the session when they
are no longer needed.
At run-time,session state can be accessed via the PortletSession object.
The PortletSession object can be retrieved by calling the getPortletSession()
method in the PortletRequest. Session attributes are represented by name/value
pairs where the name is always a string and the value is any java object.
Navigational State
Navigational state defines how the current view of the portlet is rendered and
is specific to each portlet instance. The navigational state consists of the
portlet mode,window state and any render parameters(render parameters are a
collection of string-based name/value pairs).The navigational state can be read
at any time,but it can be changed only in the processing of an action request
or by clicking on a render link that has specified new navigational state
parameters.
During the processing of an action request,the developer can change the
navigational state via the following methods on the ActionResponse object:
.setPortletMode()
.setRenderParameter()
.setRenderParameters()
.setWindowState()
To change the navigational state via a render link,the renderURL tag can be
used:
<portlet:renderRUL portletMode="edit" windowState="maximized">
<portlet:param name="foo" value="bar">
</portlet:renderURL>
This example creates a render URL that,when clicked by the user,will change
the portlet mode to edit,the window state to maximized and will add a
"foo=bar" render parameter.
It is important to note that the same navigational state will be passed to
the portlet for every render request until it is explicitly changed via
one of the methods described above.
- inter-portlet communication ,portlet之间的交互通讯,Transient State Management
- inter portlet communication library
- Websphere portal 6.1 的portlet inter-communication
- Liferay Inter-portlet communication(client side)
- Portlet之间通讯与传统的通讯方式不一样
- portlet之间的通信
- JSR286 Portlet开发:Portlet之间的Events通信
- portlet
- Portlet
- Portlet
- Portlet
- portlet
- WebSphere Portal调整portlet之间的间隙
- 转文:liferay portlet之间的通信
- liferay中的portlet之间的通信
- liferay中portlet与portlet之间通
- portlet 之间自动跳转
- Win32 行程通讯的观念与技术 Inter-process Communication?
- 转载:Python九曲之五——正则表达式
- 在 WebSphere Application Server V5 中共享连接
- FreeType2 使用心得
- linux 安装jdk1.4.2
- 关于上下文(Context)
- inter-portlet communication ,portlet之间的交互通讯,Transient State Management
- 走出绝对路径和相对路径的困惑
- 实现共享文档的多人同时操作问题
- 在struts中配置数据源
- 动态创建 MDI Form 方法
- 什么是回调函数(callback)
- c# CheckBox 全部选择与取消选择(本人认为是最简单的代码了)
- Windows系统的多显示器模式的编程
- C#异常处理机制初步