Inter Portlet Communication using Application Scope
There is a way to get JSR 168 portlets in the same portlet application to communicate with each other. As others have said if one portlet puts an object in the portlet session at "application scope," then another portlet in the same portlet application can access that variable. Portlet to Portlet communication within the same web application (same war file) can use session Application Scope.
Setting value into Application scope
Getting value from Application scope
Benefits
![]() |
Inter Portlet Communication |
Setting value into Application scope
PortletSession portletSession = getPortletSession();
portletSession.setAttribute("scope","Value",PortletSession.APPLICATION_SCOPE) ;
Getting value from Application scope
PortletSession portletSession = getPortletSession();
appScope = (String)portletSession.getAttribute("appscope",PortletSession.APPLICATION_SCOPE)
Benefits
- Is easier to implement and deploy the application.
- No limitation for the size of the data passed between the portlets.
- The portlets that need to communication with each other must be packaged in the same WAR.
- There is a performance hit to the WebSphere Portal server to enable the public session for anonymous users.
No comments:
Post a Comment