4.10. Attribute storage summary
There are many objects in the portal environment for storing attributes. In order to help you choose the right object for the right situation, refer to the following chart.
Object | Scope | Attribute Type | Programmatic Access | Best Practice |
---|---|---|---|---|
PortletRequest | Limited to request between the portal server and the portlet | object | getAttribute() setAttribute() removeAttribute() | Use a short term bucket for communication between portlet and JSP (ex: Portlet URI) |
PortletSession | Limited to subsequent requests by the same user on the same concrete portlet instance | object | getAttribute() setAttribute() removeAttribute() | Use as an open line of communication between requests. (for example Shopping cart) |
PortletSettings | Shared by all instances of the ... |
Get IBM Rational Application Developer V6 Portlet Application Development and Portal Tools now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.