在应用程序服务器 Tomcat/GlassFish 中运行动态 Web 项目

发布于 2024-09-24 13:33:28 字数 261 浏览 1 评论 0 原文

我们通过 Maven 进行了复杂的设置,其中不同的项目被打包为 war,然后相互叠加。

今天我观看了创建可以直接在 GlassFish 中运行的动态 Web 项目的教程。您编辑文件并按“保存”,所做的更改就会在 GlassFish 中看到。

由于我们的设置很复杂,我目前必须运行一些构建脚本来将文件复制到本地安装的 Tomcat。有没有办法直接在应用程序服务器上运行我的源文件(位于几个不同的 /src 文件夹中)?这样我就可以编辑文件并直接在应用程序服务器中查看它们的更改。

We have a complicated setup via Maven, where different projects are packaged as wars then overlayed on each other.

Today I watched a tutorial of creating a Dynamic Web Project that can run directly within GlassFish. You edit the files press save, and the changes are seen in GlassFish.

Since our setup is complicated, I currently have to run some build scripts to copy files to a locally installed Tomcat. Is there some way to run my source files (that are in several different /src folders) directly on an application server? So that I can edit files and see their change directly in the Application server.

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

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

发布评论

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

评论(2

我早已燃尽 2024-10-01 13:33:28

将相关 Web 应用程序的 元素的 reloadable 属性设置为 true。另请参阅 Tomcat 6.0 配置参考 - 上下文容器

可重新加载

如果您希望 Catalina 监视 /WEB-INF/classes//WEB-INF/lib 中的类,请设置为 true更改,并在检测到更改时自动重新加载 Web 应用程序。此功能在应用程序开发过程中非常有用,但需要大量的运行时开销,因此不建议在已部署的生产应用程序上使用。这就是为什么此属性的默认设置为 false。不过,您可以使用 Manager Web 应用程序来按需触发已部署应用程序的重新加载。

然而,它不像 Glassfish 那样快速高效,但也足够了。

Set the reloadable attribute of the <Context> element of the webapplication in question to true. See also the Tomcat 6.0 Configuration Reference - The Context Container

reloadable

Set to true if you want Catalina to monitor classes in /WEB-INF/classes/ and /WEB-INF/lib for changes, and automatically reload the web application if a change is detected. This feature is very useful during application development, but it requires significant runtime overhead and is not recommended for use on deployed production applications. That's why the default setting for this attribute is false. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.

It's however not as blazing fast and efficient as Glassfish does, but it may suffice.

望笑 2024-10-01 13:33:28

由于 Maven 是将项目粘合在一起的粘合剂,这是不可能的。我正在手动部署战争,然后编写许多脚本来推送文件以更新我正在处理的文件。

Due to maven being the glue holding the project together, this was not possible. I am manually deploying a war then writing many scripts to push files in to update files I'm working on.

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