掲示板

shared session : strange problem !!

16年前 に sanae khatiri によって更新されました。

shared session : strange problem !!

Junior Member 投稿: 25 参加年月日: 07/07/12 最新の投稿
Hi all,

I need to put in the shared session some attributes so I do it in the index.jsp page as follow :
session.setAttribute("myAtt", "MyAttValue");
session.setAttribute(org.apache.struts.Globals.LOCALE_KEY, myLocale);

In my portlets, I can get the org.apache.struts.Globals.LOCALE_KEY value but not the myAtt value using :

PortletSession portletSession = (PortletSession)FacesContext.getCurrentInstance().getExternalContext().getSession(true);
Object att = portletSession.getAttribute(myAtt, PortletSession.APPLICATION_SCOPE);
Locale local = portletSession.getAttribute(org.apache.struts.Globals.LOCALE_KEY, PortletSession.APPLICATION_SCOPE);

att is null but local is not !!!!

this is very strange behavior, why the session doesn't keep the myAtt attribute ??!!

any idea PLZ ??

thank you

Sanae
thumbnail
16年前 に Roman Hoyenko によって更新されました。

RE: shared session : strange problem !!

Liferay Master 投稿: 878 参加年月日: 07/10/08 最新の投稿
you can read about it here:

http://wiki.liferay.com/index.php/Liferay_FAQ#How_do_we_use_the_session_to_share_attributes_between_portlets_deployed_as_individual_WARs.3F

Basically you either need to use portlet namespace or share the session between all portlets.
16年前 に sanae khatiri によって更新されました。

RE: shared session : strange problem !!

Junior Member 投稿: 25 参加年月日: 07/07/12 最新の投稿
Hello,

Thank you very much, your post resolve my problem.

Sanae !