If we set any value in session it will be available until session available.
Include Following Line in liferay-portlet.xml:
<private-session-attributes>false</private-session-attributes>
Create session attribute in any file:
PortletSession ps = req.getPortletSession();
ps.setAttribute(key, value, PortletSession.APPLICATION_SCOPE);
Example:
ps.setAttribute("SAMPLE_ATTRIBUTE", "sample", PortletSession.APPLICATION_SCOPE);
Access in other Portlet File:
String name = ps.getAttribute("SAMPLE_ATTRIBUTE", PortletSession.APPLICATION_SCOPE);
Now name contains sample.
Wednesday, November 24, 2010
Inter Portlet Communictaion For Session Attributes
Posted by Arun on 10:51:00 AM
0 comments:
Post a Comment