How to deploy a RAP application to a servlet container?

The current eclipse build tools and wizards do not directly support building this style of application so for the time being the build can be performed with a series of Ant scripts and resource templates. The org.eclipse.rap.demo.feature shows how to create a WAR that contains the org.eclipse.rap.demo project as RAP application.

Note: As with RCP applications there are a wide variety of possible configurations. What's given in org.eclipse.rap.demo.feature is just one possibility.

As prerequisites we assume that you are familiar with the bundles- and build information section of the Equinox in a Servlet Container document. We also assume that you have a checkout of the servlet bridge bundles in your workspace. Note: This is configured to build and run against the 3.2 code base of equinox. If you are working with 3.3 use the team project set for the servlet bridge that is available here.

Prepare the build script

Create the build content

Adjust the config.ini

After that pack the WAR of the application build available in the build folder (in our case the content of build/rapdemo). Deploy the WAR to a servlet container to see whether the build was successful :-)

How to deploy my own application?

To deploy your own application like described above you will have to create your own feature. The feature should contain the same plug-in references as the demo feature (except the demo-plug-in of course!) plus the plug-ins that make up your application. It is important that your plug-ins that reference the servlet API use the Import-Package header to do this (see MANIFEST.MF of the demo project).

Copy the script and templates folder to the feature and modifiy them according to your project structure. Following the steps above should lead to a full functional WAR of your application.