Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Srikanth Reddy
Sharing HttpSession value in Different portlets in different pages
March 8, 2011 11:36 PM

Srikanth Reddy

Rank: Junior Member

Posts: 53

Join Date: June 17, 2010

Recent Posts

hi all,
I am facing an issue can any one help me here.
I am storing a a map value in httpsession in one portlet.
by using the following method

HttpServletRequest httpRequest = (HttpServletRequest)
HttpSession httpSession = httpRequest.getSession();

and storing the value .

But when i am trying to retrieve the same value in DoView() of another portlet.
like this :
//getting httpSession from portletRequest
HttpServletRequest httpServletRequest = (HttpServletRequest)PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(request));
HttpSession httpSession = httpServletRequest.getSession(true);

I am getting Null .

Can any one let me know how to share a variable through HttpSession ,which is avialable across whole portlet ,i mean in different portlets.

Thanks And regards
Dhandapani Shanmugam
RE: Sharing HttpSession value in Different portlets in different pages
March 9, 2011 1:43 AM

Dhandapani Shanmugam

Rank: Regular Member

Posts: 174

Join Date: March 24, 2009

Recent Posts

Hi Srikanth,

Why are u using HttpSession? if u want to share the values across different portlets or pages, u can go for IPC or else u can go for PortletSession with Applicaton_SCOPE...

I hope it will help u.


Dhandapani S

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!