无法重定向到Liferay中的其他页面

Sal*_*han 0 liferay liferay-6 liferay-theme liferay-velocity liferay-ide

我正在尝试使用Java代码重定向到其他页面,并且不为什么不将其重定向。下面是下面的代码

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


PortletConfig portletConfig = (PortletConfig) actionRequest.getAttribute("javax.portlet.config");

String portletName = portletConfig.getPortletName();

PortletURL successPageURL = PortletURLFactoryUtil.create(
                actionRequest, portletName+ "_WAR_" + portletName + "portlet", 
                themeDisplay.getPlid(), PortletRequest.RENDER_PHASE);

successPageURL.setParameter("jspPage", LibraryConstants.PAGE_SUCCESS);
actionResponse.sendRedirect(successPageURL.toString());
Run Code Online (Sandbox Code Playgroud)

它没有重定向到页面。请帮助检查代码是否正确。

谢谢。

Sal*_*han 5

它没有重定向的问题,因为我们必须在liferay-portlet.xml中添加一个标签,该标签是

      <action-url-redirect>true</action-url-redirect>
Run Code Online (Sandbox Code Playgroud)

在上述行之后,它起作用了。