我正在使用liferay 6.0.6。我需要在我的电子邮件中提供一个链接,以便通过单击该链接,用户应该能够将一些值带到portlet表单并提交该表单。请给我一个解决方案。
答案 0 :(得分:0)
请找到以下代码
String userName = ParamUtil.getString(actionRequest, "userName");
System.out.println("userName "+userName);
ThemeDisplay themeDisplay = (ThemeDisplay)actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
PortletURL portletUrl;
HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(actionRequest);
long plid = 0L;
Layout layout = themeDisplay.getLayout();
plid = layout.getPlid();
PortletDisplay portletDisplay= themeDisplay.getPortletDisplay();
String portletID= portletDisplay.getId();
// plid = LayoutLocalServiceUtil.getFriendlyURLLayout(themeDisplay.getScopeGroupId(), true, "/Add Participants").getPlid();
portletUrl = PortletURLFactoryUtil.create(httpRequest, "urlportlet_WAR_UrlTestportlet", plid, PortletRequest.ACTION_PHASE);
portletUrl.setWindowState(LiferayWindowState.NORMAL);
portletUrl.setParameter("javax.portlet.action", "addUser");
portletUrl.setParameter("userName", "krishnamohan");
String url = portletUrl.toString();
System.out.println("url ----> "+ url);