Deploying custom portlets in Jetspeed 2 is simple. Portlets are very similar to servlets. They require a deployment descriptor, portlet.xml which goes in WEB-INF and need to be packaged in a war-like format. You can find quite a few example portlet.xml files within the Jetspeed 2 source tree. For starters take a look at the one under /portal/src/webapp/WEB-INF.


Quick steps to deploying your portlet.

  1. Build you portlet as a portlet application just as you would a web application.
  2. Package your portlet application into a .war file.
  3. Copy the .war file to Jetspeed's deployment directory, by default this is WEB-INF/deploy. Jetspeed will take care of automatically deplying the portlet into the portlet registry and will also deploy the portlet as a web application into the app server Jetspeed is deployed to.
  4. The easiest way to view your portlet is to add an entry to the default-page.psml under jetspeed/WEB-INF/pages. The id for the portlet fragment uses a unique combination of ${}::${} where ${} is either the id in <portlet-app id="appid" > or, if that is not present, the actual name of the war file that contains your portlet app and ${} needs to be the value in the portlet name tags, <portlet-name>MyPortlet</portlet-name>. Changes to the psml will be picked up automatically and you should now be able to view your portlet!


Just copy a newer version of the same war to WEB-INF/deploy, Jetspeed will take care of the rest. Redeployment preserves all portlet preferences.


To undeploy you portlet application, follow the same steps you would to undeploy a web application from your app server. A listener will notify Jetspeed to remove the portlet application from its internal registry.


You can use the Portlet Application Lifecycle Manager (PALM) in the administration portion of Jetspeed to undeploy, stop and restart portlet applications.