【问题标题】:How to get portlet id from it's configuration portlet?如何从它的配置 portlet 中获取 portlet id?
【发布时间】:2016-11-24 10:04:27
【问题描述】:

如何在其配置portlet 的jsp 页面中获取portlet id?

从我可以在.jsp页面中调用的特定portlet级别:

String portletId = themeDisplay.getPortletDisplay().getId();

如何在配置 portlet 的 jsp 中获取该 ID?

【问题讨论】:

  • 我想你可以试试 portletSession 来存储那个 id..

标签: liferay liferay-7


【解决方案1】:

如果我理解正确,这应该会给你 portletId

final String portletResource = ParamUtil.getString(request, "portletResource");

final String portletId = PortletConstants.getRootPortletId(portletResource);

【讨论】:

    【解决方案2】:

    你好,你可以试试这个:

    String portletId = themeDisplay.getPortletDisplay().getId();
    String portletName = themeDisplay.getPortletDisplay().getPortletName();
    String portletInstanceId = themeDisplay.getPortletDisplay().getInstanceId();
    

    别忘了:

    <% ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
        themeDisplay.getUser().getScreenName(); %>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-11-27
      • 1970-01-01
      • 2016-08-20
      • 1970-01-01
      • 2013-04-09
      • 2016-07-18
      • 1970-01-01
      相关资源
      最近更新 更多