0
votes

How can I get portlet id in jsp page of it's configuration portlet?

From the level of specific portlet I can call in .jsp page:

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

How can I get that id in configuration portlet's jsp?

2
I think you can try portletSession to store that id..Abhishek Jain

2 Answers

1
votes

If I understood you correctly this should give you portletId

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

final String portletId = PortletConstants.getRootPortletId(portletResource);
0
votes

hello you can try this :

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

Don't forget:

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