Create an empty portlet project before importing a portlet WAR
file.
To import a portlet WAR file:
- Create an empty portlet project.
- Select or .
- Deselect the Create a portlet check box.
- Select a WebSphere® Portal version.
- Click Finish. If the Confirm
Perspective Switch dialog appears, click Yes.
- Import a portlet WAR file to the portlet project you created in
the step above.
- Select . Click Next.
- Select a WAR file from the local file system using the Browse button.
- For the WAR project, select the portlet
project you created above.
- Select the Overwrite existing resources without warning check
box.
- Click Finish.
- If the WAR file includes exported sources files, move them from
the source folder to the JavaSource folder.
- In the Project Explorer view, highlight the portlet project
you created in the step above.
- Expand
- Expand
- Move the contents under the source folder to
the JavaSource folder.
- Click Finish. If the Confirm
Perspective Switch dialog appears, click Yes. A portlet project and an Enterprise Application (EAR) project
are created, and the WAR file is imported.
The import will appear as a project in the Project Explorer view.
To change the target server of an existing project,
- Right-click the project in the Project Explorer view.
- Select Server.
- Change the Target runtime in the right pane. Click OK to
save the change.
Tip:After importing a portlet WAR file that uses the JSR
168 portlet API, make sure that the portlet deployment descriptor (portlet.xml)
has a unique value specified for the ID attribute on the <portlet-app> element.
To check this, double-click on the Portlet Deployment Descriptor entry for
your project in the Project Explorer view. When the Portlet Deployment Descriptor
editor opens, go to the Source tab.