简体   繁体   English

如何通过 jnlp 提供带有许多 web 应用程序的码头?

[英]How can I deliver jetty with many webapps via jnlp?

I have a webapp ( http://sourceforge.net/projects/sf-mvn-plugins/files/m2-repo/net/sf/maven/plugins/example-captaincasa-jnlp/0.1-SNAPSHOT/example-captaincasa-jnlp-0.1-SNAPSHOT.war/download ) which uses jsf in a servlet container.我有一个网络应用程序( http://sourceforge.net/projects/sf-mvn-plugins/files/m2-repo/net/sf/maven/plugins/example-captaincasa-jnlp/0.1-SNAPSHOT/example-captaincasa-jnlp -0.1-SNAPSHOT.war/download ) 在 servlet 容器中使用 jsf。 This works fine with jetty-maven-plugin run-war target at my local pc.这适用于我本地电脑上的 jetty-maven-plugin run-war 目标。 In the future I would like make more of this kind of webapps.将来我想制作更多这种网络应用程序。

I am looking for a way to deliver these webapps with jetty via jnlp.我正在寻找一种通过 jnlp 使用码头交付这些 web 应用程序的方法。 The end user should be have a zero installation but the webapps needs servlet container and my hoster does not support a servlet container or application server or so on.最终用户应该是零安装,但 webapps 需要 servlet 容器,而我的主机不支持 servlet 容器或应用程序服务器等。

I don't like an embedded solution because in this case each webapp must be delivered with a separate jetty und run with a separate jetty -> too big size -> to many download size and so on.我不喜欢嵌入式解决方案,因为在这种情况下,每个 web 应用程序都必须使用单独的码头交付并使用单独的码头运行 -> 太大 -> 下载大小太多等等。

The architecture should be similar to this:架构应该类似于: 建筑学
(source: sourceforge.net ) (来源: sourceforge.net

Example: Bundle1 could contains jetty and deployed webapp1 and Bundle2 could contains jetty and deployed webapp1 and webapp2 (related to requirements of end user I would like deliver many variant of my webapps)示例:Bundle1 可以包含 jetty 和部署的 webapp1,Bundle2 可以包含 jetty 和部署的 webapp1 和 webapp2(与最终用户的要求有关,我希望提供我的 webapp 的许多变体)

But what is my question?但我的问题是什么?

  1. Which jars of jetty are needed?需要哪些罐子码头? I would like these upload to my homepage for hosting.我希望这些上传到我的主页进行托管。
  2. Which jar should I use for jetty as main jar to start him via jnlp?我应该使用哪个罐子作为码头的主罐子来通过 jnlp 启动他?
  3. Which main class should I use to start jetty via jnlp?我应该使用哪个主类通过 jnlp 启动 jetty?
  4. Which parameter could I use to configure jetty to say this is war of webapp1 and this is war of webapp2.... or this is directory of weapps for hot deployment...?我可以使用哪个参数来配置 jetty 来说明这是 webapp1 的战争,这是 webapp2 的战争......或者这是用于热部署的 weapps 目录......?

The important question for me is 1. If this is answered so that I could run jetty local (without maven plugin) and via manual maybe I could solve the rest 2-4.对我来说重要的问题是 1。如果回答这个问题,我可以在本地运行 jetty(没有 maven 插件),并且通过手动也许我可以解决剩下的 2-4 个问题。

Why not deploy a normal Java app (with a main() etc.) that invokes Jetty programatically via its Server class?为什么不部署一个通过其Server类以编程方式调用 Jetty 的普通 Java 应用程序(使用main()等)? That class is configured via code with the appropriate contexts, servlet classes etc.该类通过具有适当上下文、servlet 类等的代码进行配置。

I've done that before with success.我以前成功地做到了这一点。 The only headache is running one Jetty with multiple apps being downloaded on request (if I read your question correctly).唯一令人头疼的是运行一个 Jetty 并根据要求下载多个应用程序(如果我正确阅读了您的问题)。 Can you use some classloading magic, and load classes/apps on demand from a remote URL ?您可以使用一些类加载魔法,并从远程 URL 按需加载类/应用程序吗?

I have found another way today.我今天找到了另一种方法。 This is interesting too.这也很有趣。 Here is the concept:这是一个概念:

  1. Use java webstart to install an osgi container使用 java webstart 安装 osgi 容器
  2. Use a bundle x or a osgi service to download all bundles of your app使用 bundle x 或 osgi 服务下载您的应用程序的所有捆绑包
  3. Use the jetty bundle to provide jetty support使用 jetty bundle 提供码头支持

Then the application is installed然后安装应用程序

I got the idea from this article: http://www.toedter.com/blog/?p=45我从这篇文章中得到了这个想法: http : //www.toedter.com/blog/?p=45

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM