通过点击liferay中的链接提交表单

时间:2014-01-23 11:45:30

标签: hyperlink liferay liferay-6

我正在使用liferay 6.0.6。我需要在我的电子邮件中提供一个链接,以便通过单击该链接,用户应该能够将一些值带到portlet表单并提交该表单。请给我一个解决方案。

1 个答案:

答案 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);