如何通过 jnlp 为 jetty 提供许多 Web 应用程序?

发布于 2024-08-23 09:13:24 字数 1409 浏览 3 评论 0原文

我有一个网络应用程序(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。这与我本地电脑上的 jetty-maven-plugin run-war 目标配合得很好。将来我想制作更多此类网络应用程序。

我正在寻找一种通过 jnlp 使用 jetty 交付这些 Web 应用程序的方法。最终用户应该是零安装,但 web 应用程序需要 servlet 容器,而我的主机不支持 servlet 容器或应用程序服务器等。

我不喜欢嵌入式解决方案,因为在这种情况下,每个 Web 应用程序都必须使用单独的码头交付并使用单独的码头运行 ->尺寸太大->许多下载大小等等。

该架构应该与此类似: 架构
(来源:sourceforge.net

示例: Bundle1 可以包含 jetty 和部署的 webapp1,Bundle2 可以包含 jetty 和部署的 webapp1 和 webapp2 (与最终用户的要求相关,我想提供我的 webapp 的许多变体)

但是我的问题是什么?

  1. 需要哪些码头罐子?我想将这些上传到我的主页进行托管。
  2. 我应该使用哪个 jar 作为 jetty 的主 jar 来通过 jnlp 启动他?
  3. 我应该使用哪个主类通过 jnlp 启动 jetty?
  4. 我可以使用哪个参数来配置 jetty 来表示这是 webapp1 的战争,这是 webapp2 的战争....或者这是用于热部署的 weapps 目录...?

对我来说重要的问题是 1。如果这个问题得到解答,以便我可以在本地运行 jetty(无需 Maven 插件)并通过手册,也许我可以解决其余的 2-4 个问题。

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. This works fine with jetty-maven-plugin run-war target at my local pc. 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. 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.

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.

The architecture should be similar to this:
architecture
(source: 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)

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?
  3. Which main class should I use to start jetty via jnlp?
  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...?

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.

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

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

发布评论

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

评论(2

偷得浮生 2024-08-30 09:13:24

为什么不部署一个普通的 Java 应用程序(带有 main() 等),通过其 Server 类?该类是通过具有适当上下文、Servlet 类等的代码进行配置的。

我之前已经成功完成了该操作。唯一令人头疼的是运行一个 Jetty,并根据请求下载多个应用程序(如果我正确地阅读了您的问题)。您可以使用一些类加载魔法,并根据需要从远程 URL 加载类/应用程序吗?

Why not deploy a normal Java app (with a main() etc.) that invokes Jetty programatically via its Server class? That class is configured via code with the appropriate contexts, servlet classes etc.

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). Can you use some classloading magic, and load classes/apps on demand from a remote URL ?

合久必婚 2024-08-30 09:13:24

我今天找到了另一种方法。这也很有趣。概念如下:

  1. 使用 java webstart 安装 osgi 容器
  2. 使用捆绑包 x 或 osgi 服务下载应用程序的所有捆绑包
  3. 使用 jetty 捆绑包提供 jetty 支持

然后安装应用程序

我从这篇文章中得到了这个想法:
http://www.toedter.com/blog/?p =45

I have found another way today. This is interesting too. Here is the concept:

  1. Use java webstart to install an osgi container
  2. Use a bundle x or a osgi service to download all bundles of your app
  3. Use the jetty bundle to provide jetty support

Then the application is installed

I got the idea from this article:
http://www.toedter.com/blog/?p=45

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