OSGi 容器中的 web.xml

发布于 2024-10-11 14:50:42 字数 233 浏览 4 评论 0原文

优点!看起来像是基本问题,但我只是找不到我要找的东西。

我有 Equinox 并想在其中运行 Spring(在 Servlet 中引导)。 我不能使用 dm-server,也不能使用 http-bridge,只是普通的独立 Equinox。 另一方面,使用plugin.xml http注册servlet扩展还不够好,因为我需要成熟的web.xml来引导Spring。

我应该在哪里挖?

谢谢! 巴鲁克。

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

I have Equinox and want to run Spring in it (bootstraped in Servlet).
I can't use dm-server, nor can I use the http-bridge, just plain standalone Equinox.
On the other side, using plugin.xml http registry servlet extension is not good enough, since I need the fully-blown web.xml in order to bootstrap Spring.

Where should I dig?

Thanks!
Baruch.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我为君王 2024-10-18 14:50:42

要支持用于 Web 应用程序部署的“传统”(又名遗留)web.xml 文件,您需要实现 OSGi Web 应用程序规范(OSGi R4.2 Enterprise 规范的一部分)。这将允许您部署“Web 应用程序包”(WAB) 甚至普通的旧 WAR 文件。

Eclipse Gemini 和 Apache Aries 项目中都有此容器的实现。请注意,在 Eclipse Gemini 中找到的那个也可以在 Eclipse Virgo(dm Server 的新名称)中找到。您可能会发现使用 Virgo 将为您带来更干净的开箱即用体验,而不必自己组装组件。然后我再次完全理解它是否也提供了比您真正想要的更多的东西!

另一种方法是放弃 web.xml 并通过 OSGi HttpService 以编程方式注册 servlet。这应该更加轻量级,但我不知道它是否适用于“引导 Spring”——这是一个相当模糊的要求。

To support "traditional" (aka legacy) web.xml file for webapp deployment you need an implementation of the OSGi Web Applications spec, part of the OSGi R4.2 Enterprise spec. This will allow you to deploy "Web Application Bundles" (WABs) or even plain old WAR files.

There are implementations of this container in both the Eclipse Gemini and Apache Aries projects. Note that the one found in Eclipse Gemini is also found in Eclipse Virgo (the new name for dm Server). You may find that using Virgo will give you a cleaner out-of-the-box experience rather than having to assemble components yourself. Then again I fully understand if it also provides an awful lot more than you really want!

An alternative to this is to move away from web.xml and to register servlets programmatically with the OSGi HttpService. This should be a lot more lightweight, but I don't know whether it will work for "bootstrapping Spring" — quite a vague requirement.

罪歌 2024-10-18 14:50:42

或者您可以使用 tomcat OSGi 包,这将使您能够将包作为 war 文件加载。问题在于您的 Web 包的名称必须以“.war”结尾,而该后缀之前的所有内容都是应用程序名称。因此,如果您的包的名称是 myapp.war,您可以使用 http://your.server.cc/myapp (据我所知,没有办法改变这一点)

Or you can use the tomcat OSGi bundle that will make you to be able to load bundles as war files. The problem there is that your web bundle's name must end with ".war" and all that stands before that suffix is the application name. So if your bundle's name is myapp.war you connect to it with http://your.server.cc/myapp (and as far as i know there's no way to change that)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文