Liferay Symposium 2016 | Reserve your seat today.
(Opens New Window)
Mark as an Answer
How to get request object in liferay using struts2
February 27, 2013 11:24 AM
Rank: Junior Member
Join Date: October 18, 2012
I tried to get the request object in struts 2 action class but failed .
Below are the ways i tried to get the object
1 By implementing the portletRequestAware,portletRespnseAware and portletContext to the action class - In this request object is NULL
2 Using PortletActionContext
PortletRequest portletRequest = PortletActionContext.getRequest((); - Request object is null
RenderRequest renderRequest =PortletActionContext.getRenderRequest((); - Request object is null
ActionRequest actionRequest = PortletActionContect.getActionReques();t - Request object is null
After all tries I print the phases(action,render,event) of the request using PortletActionContext.In that event phase is true.
My question:How can i get the request object in event phase and I just click on the navigation(/home) button why the request phase is event?
The purpose of getting the request objecct is to get the logged in person UserId.
Sign in to vote.
Please sign in to flag this as inappropriate.