Did you write the <js:services> things into a jetspeed-portlet.xml and put it into the WEB-INF/ directory of your web application as David said? I think you should first have a look at the jetspeed-portlet.xml in the webapps/j2-admin/WEB-INF/ directory as an example. I think you may also need to redeploy your portlet application after these changes.

Dan Olsen wrote:
When I do this I then get the following error in my portlet: "Could not get instance 
of portal statistics component".

David Sean Taylor [EMAIL PROTECTED]> 6/3/2008 1:58 PM >> ( mailto:[EMAIL 
PROTECTED]> )

Here is an arbitrary example of using a Jetspeed service in a portlet's init:

     private PortalStatistics statistics;


     public void init(PortletConfig config) throws PortletException
     {
         super.init(config);
         PortletContext context = getPortletContext();
         statistics = (PortalStatistics) context
.getAttribute (CommonPortletServices.CPS_PORTAL_STATISTICS);
         if (statistics == null)
                 throw new PortletException(
"Could not get instance of portal statistics component");
     }


and then perhaps in your processAction:

...
DataSource ds = statistics.getDataSource();







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to