I am trying to share the httpsession between themes and portlet in different portlet application. But it always return null value in the portlet.
The themes is posting in to a servlet to store httpsession :
HttpSession session = request.getSession();
session.setAttribute("testsession", "testsession");
and i tried to retrieve the session in portlet with following ways:
1)
HttpSession session = httpRequest.getSession(false);
System.out.println("session "+session.getAttribute("testsession"));
2)
System.out.println("portletsession :"+renderRequest.getPortletSession().getAttribute("testsession", PortletSession.APPLICATION_SCOPE));
3)
HttpSession httpSession = PortalUtil.getHttpServletRequest(renderRequest).getSession(false);
System.out.println("httpSession 212 in java : "+httpSession.getAttribute("testsession"));
All of the above return null. Does anyone have experience in implementing this behaviour before ?
Thanks,
Cyril