Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do we use the session to share attributes between portlets deployed as individual WARs?

0
10 Posted

How do we use the session to share attributes between portlets deployed as individual WARs?

0
10

Overview: All portlets (both in the Liferay EAR and deployed as individual WARs) are able to share attributes using the default HttpSession object using 2 different methods NOTE: If all portlets are packaged in the same WAR, those portlets will share the same session, but they will have a different session than the portal since the portal is in its own WAR. Method 1 – Sharing attributes between portlets: This method involves giving portlets access to the portal’s session. Namespacing is not used in this method. This method is desirable for most scenarios, however there is the potential for a portlet to overwrite another portlet’s (or even the portal’s) attributes being stored in the session. For example, suppose after a user logs in, the portal sets an object called “user” in the session. If one of the portlets were also to set an object called “user” in the session, the previous “user” object would be clobbered.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123