Get the App
SLTechnology News&Howtos  ›  Development  › 

How to deploy Eclipse RAP to Tomcat

Shulou Source: shulou.com Published: 2022-06-02 12:20:51 10月03日 Update

This article is about deploying Eclipse RAP to Tomcat. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.

If Eclipse RAP is installed, open the help interface and find the RAP help document "How to deploy a RAP application to a servlet container?" "This article, the article provides a link to download a psf, this is Eclipse project set file, the file content is as follows:

< ?xml version="1.0" encoding="UTF-8"?>

< psf version="2.0">

< provider id="org.eclipse.team.cvs.core.cvsnature">

< project reference="1.0,:pserver:anonymous@dev.eclipse.org:/cvsroot/rt,org.eclipse.equinox/server-side/bundles/org.eclipse.equinox.http.servletbridge,org.eclipse.equinox.http.servletbridge"/>

< project reference="1.0,:pserver:anonymous@dev.eclipse.org:/cvsroot/rt,org.eclipse.equinox/server-side/bundles/org.eclipse.equinox.servletbridge,org.eclipse.equinox.servletbridge"/>

< project reference="1.0,:pserver:anonymous@dev.eclipse.org:/cvsroot/rt,org.eclipse.rap/releng/org.eclipse.rap.demo.feature,org.eclipse.rap.demo.feature"/>

< /provider>

< /psf>

You can also copy the content to a text file and change it to yourpsfile.psf file, import it into Eclipse as Eclipse project set, Eclipse will automatically download the corresponding plug-in from Eclipse CVS website, a total of three plug-ins were downloaded:

org.eclipse.equinox.http.servletbridge

org.eclipse.equinox.servletbridge

org.eclipse.rap.demo.feature

Open the webappBuilder.xml file under the script folder of the org.eclipse.rap.demo.feature project, modify the attribute value named "servletbridge.dir"(as if in line 18), and modify the value to the path of your "org.eclipse.equinox.servletbridge" project. It is recommended to use an absolute path, such as:

< property name="servletbridge.dir" value="D:/DeveloperWorks/Eclipse-3.5-RAP-SRC/org.eclipse.equinox.servletbridge" />

Then run the compilation directly using Ant, which will generate deployable files under the build folder of the plug-in. This prepares you to deploy Eclipse RAP to Tomcat.

Open the generated web.xml file and add the following content that has already been commented

< !-- < init-param>

< param-name>

commandline

< /param-name>

< param-value>

-console

< /param-value>

< /init-param>

-->

Restore to normal code, so that you can use OSGI console in Tomcat console, convenient to view and manage plug-in life cycle, complete plug-in update and uninstall functions, and then

< init-param>

< param-name>

enableFrameworkControls

< /param-name>

< param-value>

false

< /param-value>

< /init-param>

Change the parameter value from false to true, which enables control of the OSGI framework and facilitates debugging.

Then copy the contents under the demo folder under the build folder under org.eclipse.rap.demo.feature project to the webapps directory of Tomcat, start Tomcat, and enter "ss" on the console to view the plug-ins that have been loaded under the OSGI framework:

You can see that our deployed org.eclipse.rap.demo file is already active.

Open your browser and type http://localhost:8080/demo/rap to access it.

Thank you for reading! About "how to deploy Eclipse RAP to Tomcat" this article is shared here, I hope the above content can be of some help to everyone, so that we can learn more knowledge, if you think the article is good, you can share it to let more people see it!

Tags: Files content plug-ins projects folders controls console articles help Properties articles more frames paths facets generate input run good practical Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Technology Huawei macOS NVidia