Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
httpsession attribute sharing between modules Liferay 7.1
I wanted to share some value between PostloginAction and module. But I am getting null in module.
In PostLoginAction:
httpSession.setAttribute("LIFERAY_SHARED_USER_ORG", organization);
In other module:
HttpServletRequest httpReq = PortalUtil.getHttpServletRequest(portletRequest);
HttpSession httpSession = httpReq.getSession();
Object sessionObj = httpSession.
getAttribute("LIFERAY_SHARED_USER_ORG");
if(sessionObj != null){
userOrg = (Organization)sessionObj;
}
Alway i am getting null value.
Thanks,
Abdul
In PostLoginAction:
httpSession.setAttribute("LIFERAY_SHARED_USER_ORG", organization);
In other module:
HttpServletRequest httpReq = PortalUtil.getHttpServletRequest(portletRequest);
HttpSession httpSession = httpReq.getSession();
Object sessionObj = httpSession.
getAttribute("LIFERAY_SHARED_USER_ORG");
if(sessionObj != null){
userOrg = (Organization)sessionObj;
}
Alway i am getting null value.
Thanks,
Abdul
Abdul KareemI wanted to share some value between PostloginAction and module. But I am getting null in module.I've recently answered a similar question on stackoverflow, with a link back to the blogs on this site. It may provide some insight and hints.
And this related recent question on stackoverflow might provide some additional background on the sharing between a non-portlet and portlet-module.
Thanks Olaf for the response.
I got the solution for this.
HttpServletRequest httpActualServletRequest = PortalUtil.getHttpServletRequest(renderRequest);HttpSession httpSession = PortalUtil.getOriginalServletRequest(httpActualServletRequest).getSession();
Using the above code I am getting the value.
Thanks,
Abdul Kareem
I got the solution for this.
HttpServletRequest httpActualServletRequest = PortalUtil.getHttpServletRequest(renderRequest);HttpSession httpSession = PortalUtil.getOriginalServletRequest(httpActualServletRequest).getSession();
Using the above code I am getting the value.
Thanks,
Abdul Kareem
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™