Quantcast
Channel: It's all about Java and Liferay
Viewing all articles
Browse latest Browse all 12

Redirect to Static page in liferay within a single portlet

$
0
0
In Liferay most of time happens with us that after submitting the form we want to redirect it to some other page.

Now it's not difficult any more.

Please check below code.It will help you to redirect to the Static page as you are aspecting in liferay.
String portletName = (String)actionRequest.getAttribute(WebKeys.PORTLET_ID);

ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);

PortletURL redirectURL = PortletURLFactoryUtil.create(PortalUtil.getHttpServletRequest(actionRequest),
portletName,
themeDisplay.getLayout().getPlid(), PortletRequest.RENDER_PHASE);

redirectURL.setParameter("jspPage", "your jsp path");

actionResponse.sendRedirect(redirectURL.toString()); 
Congratulations, You have DONE NOW !!!!!!!

Viewing all articles
Browse latest Browse all 12

Trending Articles