Jetty:嵌入还是不嵌入?

发布于 2024-08-23 04:47:24 字数 299 浏览 5 评论 0原文

嵌入 jetty 与 在 jetty 中部署你的 web 应用程序?如果您计划部署多个 Web 应用程序,是否应该严格坚持为每个 Web 应用程序部署一个 war 文件(而不是编写一个调用每个 Web 应用程序的嵌入式服务器)?

What are the benefits of embedding jetty vs deploying your webapp(s) in jetty? If you are planning on deploying more than one web app, should you strictly stick with deploying a war file for each web app (as opposed to writing an embedded server which calls each web app)?

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

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

发布评论

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

评论(3

淡紫姑娘! 2024-08-30 04:47:24

当目标是创建一个独立的应用程序时,我会使用嵌入的jetty,其中jetty只是其中的组件之一(例如在osgi容器中)。如果您只想部署一些战争,那么默认的码头安装似乎更可取。
我认为这一选择并不取决于您是否计划部署多个网络应用程序。当您嵌入码头时,您必须在代码中自行填充。

i'd use jetty embedded when the goal is to create a standalone application in which jetty is just one of the components (for example in an osgi container). if you just want to deploy some war's then a default jetty installation seems more preferable.
i don't think the choice depends on whether you plan to deploy more than one webapp. when you embed jetty you'll have to do the plumping yourselves in your code.

划一舟意中人 2024-08-30 04:47:24

嵌入 jetty 在我熟悉的两种情况下很方便:

  1. JNI。确保您在正确的类加载器中拥有正确的内容要容易得多。

  2. 发展。在 Eclipse 中启动嵌入式码头比使用 Eclipse Web 工具并处理部署和调试器附加要容易得多。

Embedding jetty is handy in two cases I'm familiar with:

  1. JNI. It's a lot easier to make sure you've got the right things in the right class loader.

  2. Development. It's much easier to fire up an embedded jetty in eclipse than to dance around with the eclipse web tools and deal with deployments and debugger attaching.

但可醉心 2024-08-30 04:47:24

查看 Winstone servlet 容器,它允许您将单个 WAR 文件作为可执行 jar 分发作为支持的用途案件。这就是哈德森所做的。

Have a look at the Winstone servlet container which allows you to distribute a single WAR file as an executable jar as a supported use case. This is what Hudson does.

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