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
Redirect to a different Liferay page using the action response
I want to redirect the user from /page1 to /page2, and pass a value along with it. This value needs to be available to read inside the render class of a different portlet on page2 . I've tried the following steps and It didn't work.
#1
actionResponse.setRenderParameter("param", "value"); // also tried addProperty, & setProperty
actionResponse.sendRedirect("/page2");
Without the 'setRenderParameter' the redirect works.
#2
We used HttpSession and it worked in our DEV. but failed in the clustered PROD env. due the session replication issues. So , we can't depend on the HtttpSession. Moreover, Liferay seems to be against the use of HttpSession , according to this blog.
.:. This user is an unauthenticated user so we can't depend on DB
#1
actionResponse.setRenderParameter("param", "value"); // also tried addProperty, & setProperty
actionResponse.sendRedirect("/page2");
Without the 'setRenderParameter' the redirect works.
#2
We used HttpSession and it worked in our DEV. but failed in the clustered PROD env. due the session replication issues. So , we can't depend on the HtttpSession. Moreover, Liferay seems to be against the use of HttpSession , according to this blog.
.:. This user is an unauthenticated user so we can't depend on DB
Hi,
You can try creating PortletURL with plid of the page you want to redirect and portletname of the portlet where you want to fetch the parameters
You can try creating PortletURL with plid of the page you want to redirect and portletname of the portlet where you want to fetch the parameters
PortletURL portletURL = PortletURLFactoryUtil.create(httpRequest ,portletId, plid ,PortletRequest.RENDER_PHASE);
portletURL.setParameter(name, value);