Eclipse 中的 Jetty - 从 .war 加载静态内容

发布于 2024-10-04 05:25:13 字数 264 浏览 8 评论 0原文

我在 Eclipse 中运行 Jetty,并与 Jetty 服务器适配器一起安装。我正在构建一个 Tapestry 应用程序,并且实时类重新加载效果非常好。然而,对静态资产(例如图像和 CSS)的更改不会立即反映出来:我必须执行 Jetty 重新启动-重建-重新部署,这非常慢。

我认为原因是我的应用程序被部署为 .war,而 Jetty 正在从这里读取静态资产。显然,.war 仅通过重建重新部署进行更新。

如何让 Jetty 直接从我的工作区加载静态内容?

谢谢

I'm running Jetty from within Eclipse, installed with the Jetty Server Adaptor. I'm building a Tapestry app, and live class reloading works great. However, changes to static assets, such as images and css are not being instantly reflected: I have to do a Jetty restart-rebuild-redeploy, which is quite slow.

I think the reason for this is that my app is being deployed as a .war, and Jetty is reading static assets from here. Obviously the .war is only updated with a rebuild-redeploy.

How can I get Jetty to load static content directly from my workspace?

Thanks

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

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

发布评论

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

评论(2

黑凤梨 2024-10-11 05:25:13

It might not be possible to deploy an exploded war using the current version of the Jetty eclipse WTP plugin, at least according to this outstanding feature request.

An alternative solution would be to run Jetty manually instead of through Eclipse WTP, this would allow you to deploy the web app exploded. Although you'd need to hack a script together to copy static resources to the deployment directory as and when they change in the source folder in your eclipse project.

妄想挽回 2024-10-11 05:25:13

将 Jetty 的 webdefault.xml 中名为 useFileMappedBuffer 的参数调整为 false 应该可以防止在从 Eclipse 运行 Jetty 时锁定静态文件。

Adjusting a parameter in Jetty's webdefault.xml named useFileMappedBuffer to be false should prevent locking of static files when running Jetty from Eclipse.

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