facebook

Portlet Support in MyEclipse

This overview includes information on the creation of portlet projects and deploying of the portlets on WebSphere. 

This feature is available in MyEclipse.


1.  Portlet Support for Web Projects

To create a Portlet project, first start with an existing MyEclipse Web project, and then add JSR Portlet facets to provide Portlet support. Portlet support includes a configured web.xml (for Portal engines that have this requirement), generated portlet.xml, and all necessary JSR 168 or 286 runtime libraries.

Adding the Portlet facet to Web a project

The Install JSR Portlets Facet wizard allows you to select the specific Portal engine to support.

Selecting the portal engine

After adding Portlet facets, the Web project is configured with JSR 168 or 286 runtime libraries, web.xml contains the necessary configuration, and a portlet.xml file is added to the project.

Initial Portlet project contents


2. New Portlet Wizard

MyEclipse provides a wizards for creating a JSR 168 or 286-compliant Portlet. Select File>New>Other from the menu, expand MyEclipse>Web, and choose Portlet.

Creating a new Portlet project

The Add New Portlet wizard creates the Portlet class and other required (or optional) resources in addition to registering the new portlet in the portlet.xml descriptor. The first page of the wizard configures the Portlet class and allows you to select from the list of predefined Portlet templates.

Configuring the portlet

MyEclipse provides the following Portlet templates:

    • Portlet with JSPs – Delegates all requests to JSPs corresponding to portlet mode. This allows clearer separation of the application logic from the UI and to leverage JSP support provided by MyEclipse IDE.
    • Simple Portlet – Creates a simple Portlet class with method stubs for the request handling methods.

The second page of the wizard allows further customize your new portlet and to specify template-specific portlet settings.

Adding template-specific Portlet settings


3. Deploying Portlet Applications

MyEclipse does not currently support direct deployment of Portal Web projects directly to a portal server. The reason for this is that each portlet server can have varying deployment requirements, and at the moment, the deployment tool in MyEclipse can’t deploy Portlets to those servers. However, MyEclipse with WebSphere support does provide direct portal development and deployment support for WebSphere Portal Server.

To deploy portal applications to compatible portal engines, export the project as a deployable WAR file. Select File>Export from the menu, expand JavaEE, and choose WAR file (MyEclipse).

Exporting to a WAR

Deploy the resulting WAR file to the portal server using server-specific deployment tools, or follow the specific deployment instructions provided by the portlet server.