[英]Communication between OSGI bundle and web application
I want to build a web application in combination with OSGI to modularize it. 我想结合OSGI构建一个Web应用程序以对其进行模块化。 But I'm a little bit confused.
但是我有点困惑。 I build an OSGI web bundle with a simple Hello Word Servlet.
我用一个简单的Hello Word Servlet构建了一个OSGI Web捆绑包。 It works.
有用。 But now, how can I create a "complete" web application and not only a Servlet?
但是现在,我如何才能创建一个“完整的” Web应用程序,而不仅仅是Servlet?
For example I don't know how to reference to different *.html files, et cetera. 例如,我不知道如何引用不同的* .html文件等等。 In typical Java EE web apps you have the WEB-INF folder, et cetera.
在典型的Java EE Web应用程序中,您具有WEB-INF文件夹等。 But not in this case.
但在这种情况下不是。 There is only the Servlet.java which generates the output.
只有Servlet.java生成输出。
So how can I create a "complete" web application and how can it's backend access other osgi bundles I created? 那么如何创建一个“完整的” Web应用程序,以及它的后端如何访问我创建的其他osgi包?
Are there any good tutorials? 有没有好的教程? I find several tutorials which only create the Servlet.
我找到一些仅创建Servlet的教程。
Actually there are different approaches available, depending on what you want to achieve. 实际上,根据您要实现的目标,可以使用不同的方法。 The most favored way right now would be to use the Http Whiteboard approach.
目前最受青睐的方法是使用Http Whiteboard方法。 In that way you'd register your Servlets as Services and while doing so you still can receive Services in your Servlet itself.
这样,您就可以将Servlet注册为服务,同时您仍可以在Servlet本身中接收服务。 A good starting point is to look at either PAX-Web Samples or Apache Felix Whiteboard .
一个好的起点是查看PAX-Web Samples或Apache Felix Whiteboard 。
Please look at the OSGi enRoute tutorials which demonstrate building web applications with OSGi. 请查看OSGi enRoute教程,这些教程演示了如何使用OSGi构建Web应用程序。 http://enroute.osgi.org/
http://enroute.osgi.org/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.