1 Reply Latest reply on Nov 26, 2008 6:47 AM by cpage cpage

    Portlet Instance ID

    Freddie Mercury Newbie

      Hi,
      how can I get the portlet instance id in a doView method???

      Please help me. Thanks.

        • 1. Re: Portlet Instance ID
          cpage cpage Novice

          I don't know if it's the good method but you can do something like that.

          You need to cast the request to JBossRenderRequest and obtain the "PortalObjectContainer" (through injection or MBeanServer) :

          PortalNodeImpl windowNodeImpl = (PortalNodeImpl) jbossRequest.getPortalNode();
          PortalObjectId windowObjectId = windowNodeImpl.getObjectId();
          Window window = (Window) portalObjectContainer.getObject(windowObjectId);
          String instanceId = ((PortletContent) window.getContent()).getInstanceRef();