Web.xml in the OSGi container

pros! Looks like a basic question, but I just can't find what I'm looking for.

I have Equinox and you want to run Spring in it (bootstraped in Servlet). I cannot use dm-server, and I cannot use http-bridge, just standalone Equinox. On the other hand, the plugin.xml http plugin extension is not suitable, as I need a completely exploded web.xml to load Spring.

Where should I dig?

Thanks! Baruch.

+4
source share
2 answers

To support the "traditional" (aka legacy) web.xml for deploying webapp, you will need to implement the OSGi Web Applications specification, which is part of the OSGi R4.2 Enterprise specification. This will allow you to deploy Web Application Packages (WABs) or even old, old WAR files.

There are implementations of this container in the Eclipse Gemini and Apache Aries projects. Note that the Gemini found in Eclipse is also found in Eclipse Virgo (new name for the dm server). You may find that using Virgo will give you a cleaner “out of the box” experience, rather than assembling the components yourself. And again, I fully understand if it also provides much more than you really want!

An alternative is to switch from web.xml and programmatically start servlets with OSGi HttpService . This should be much easier, but I don’t know if it will work for “Spring bootstrap” - a rather vague requirement.

+6
source

Or you can use the Tomcat OSGi kit, which allows you to download packages as war files. The problem is that your website name must end with ".war" and all that suffix is ​​the name of the application. Therefore, if your package name is myapp.war, you connect to it using http://your.server.cc/myapp (and as far as I know, there is no way to change this)

0
source

Source: https://habr.com/ru/post/1335244/


All Articles