Sun Java System Portal Server 7 Developer's Guide

Overview of Developing and Deploying Portlets

The portlet API includes a GenericPortlet abstract class that implements the Portlet interface and the PortletConfig interface. This class provides access to the following common portlet functionality:

Dispatch processing for portlet URLs

The render method is implemented to determine current portlet mode and to call the appropriate method.

Accessor for the portlet’s configuration

The class includes an easy mechanism to obtain portlet’s initialization parameters.

Accessor for the portlet’s context

The class includes an accessor method to obtain a reference to the PortletContext interface that enables portlets to interface with the container.

ProcedureTo develop and deploy portlets

Steps
  1. Develop the portlet class files.

    A portlet must implement the javax.portlet.Portlet interface. This interface defines the basic behavior that the portlet container expects from a portlet.

  2. Create the portlet specific XML fragments and package it into a WAR file.

  3. Deploy the Portlet web application.

  4. Create and view the Portlets.