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.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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("parameter", "value"); // set required parameter that you need in doView or render Method | |
actionResponse.sendRedirect(redirectURL.toString()); |
Congratulations, You have DONE NOW !!!!!!!
No comments:
Post a Comment