Victor
Victor

Reputation: 17107

A portlet application should be deployed as war file or ear file

In the websphere portal environment, how is a portal application consisting of many portlets supposed to be deployed? As a .war file or a .ear file?

I see that on environments that do not have RAD installed, it is deployed as a .war. But on the dev machine which has RAD installed, it is deployed as an EAR project. Is there a best practise around this?

Upvotes: 1

Views: 1686

Answers (1)

Carlos Gavidia-Calderon
Carlos Gavidia-Calderon

Reputation: 7243

I'll assume you're using WebSphere Portal. From the product documentation:

Portlet applications are usually packaged into single WAR files. These WAR files can be directly deployed into the portal by using portal administration means (...). You might want to deploy portlet applications together with EJBs, or bundle several WAR files into the same EAR file, or work with similar scenarios. For this type of requirement WebSphere Portal provides the predeployed mode with the XML configuration interface (...)

And then it shows several additional steps to make your EAR work with WebSphere Portal. You can see that Portlet Application WAR files are the recommended, simpler and cleaner way to install Portlets in WebSphere Portal and will save you from very annoying administrative tasks. Also, a single WAR file can contain several Portlets so you're covered in that aspect too.

As an additional detail, when you deploy a WAR file to WebSphere Portal it wraps the file in an EAR before deploying so there's no big difference if you choose one or another.

Upvotes: 1

Related Questions