简体   繁体   English

OSGI软件包与Web应用程序之间的通信

[英]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 SamplesApache 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.

相关问题 骆驼+保险丝中战争与osgi捆绑包之间的交叉通信 - Cross communication between war and osgi bundle in camel + fuse 嵌入式OSGi或应用程序包 - Embedded OSGi or Application Bundle Glassfish,OSGi Web应用程序捆绑包(WAB)和虚拟服务器 - Glassfish, OSGi web application bundle (WAB) and virtual servers 在Tomcat中使用来自Java Web应用程序的OSGi Bundle - Using an OSGi Bundle from a Java Web Application in Tomcat 如何将log4j添加到使用OSGI捆绑包的Web应用程序 - How to add log4j to a web application that use OSGI bundle OSGi felix:在主机应用程序和捆绑包之间共享一个类可能吗? - OSGi felix: Sharing a class between the host application and a bundle possible? OSGI关于Glassfish的捆绑软件间通信 - OSGI Inter-bundle Communication on Glassfish 为OSGI容器创建一个Web应用程序包(WAB),该容器不包含maven-bundle-plugin的所有依赖项jar - Create a Web Application Bundle (WAB) for a OSGI container that does NOT contain jar of all dependencies with maven-bundle-plugin Web应用程序的两个客户端之间的通信 - Communication between two clients of web application Mule-Web应用程序与Mule ESB之间的通信 - Mule - Communication between Web application and Mule ESB
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM