Vaadin supports running applications as portlets, as defined in the JSR-168 (Java Portlet API) and JSR-286 (Java Portlet API 2.0) standards. While providing generic support for all portals implementing the standards, Vaadin especially supports the Liferay portal and the needed portal-specific configuration is given below for Liferay.

You can deploy the Vaadin demo package WAR (available from the download site) directly to a portal such as Liferay. It contains all the necessary portlet configuration files. For optimal performance with Liferay, you can install the Vaadin library and other needed resources in Liferay as described later in this section.

You can find more documentation and examples from the Vaadin Developer's Site at http://dev.vaadin.com/.

Deploying a Vaadin application as a portlet is essentially just as easy as deploying a regular application to an application server. You do not need to make any changes to the application itself, but only the following:

  • Application packaged as a WAR

    • WEB-INF/portlet.xml descriptor

    • WEB-INF/web.xml descriptor for Portlet 1.0 portlets

    • WEB-INF/liferay-portlet.xml descriptor for Liferay

    • WEB-INF/liferay-display.xml descriptor for Liferay

    • WEB-INF/liferay-plugin-package.properties for Liferay

  • Widget set installed to portal (optional)
  • Themes installed to portal (optional)
  • Vaadin library installed to portal (optional)
  • Portal configuration settings (optional)

Installing the widget set and themes to the portal is required for running two or more Vaadin portlets simultaneously in a single portal page. As this situation occurs quite easily, we recommend installing them in any case.

In addition to the Vaadin library, you will need to copy the portlet.jar to your project. Notice that you must not put the portlet.jar in the same WebContent/WEB-INF/lib directory as the Vaadin JAR or otherwise include it in the WAR to be deployed, because it would create a conflict with the internal portlet library of the portal. The conflict would cause errors such as "ClassCastException: ...ApplicationPortlet2 cannot be cast to javax.portlet.Portlet".

How you actually deploy a WAR package depends on the portal. In Liferay, you simply drop it to the deploy subdirectory under the Liferay installation directory. The deployment depends on the application server under which Liferay runs; for example, if you use Liferay bundled with Tomcat, you will find the extracted package in the webapps directory under the Tomcat installation directory included in Liferay.