gpt4 book ai didi

eclipse - 如何使 eclipse + tomcat 即时部署 webapps

转载 作者:行者123 更新时间:2023-11-28 22:01:45 27 4
gpt4 key购买 nike

我构建了一个 Maven 项目并将这场 war 部署到 tomcat webapps 文件夹中,然后启动了 tomcat,这样我的应用程序就可以在浏览器中作为 localhost:8080/myApp

我可以在 tomcat/webapps 下看到从 myApp.war 中提取的 myApp 文件夹。

我可以通过使用 Notepad++ 编辑 tomcat/webapps/myApp/.. 下的文件来修改此应用程序的 UI。

我将这个项目发送给我的同事,他也在他的 eclipse 中导入了这个项目并运行了这个应用程序。

他从eclipse中改了jsp和js文件,结果会在浏览器中反射(reflect)出来,他从来没有用过单独的编辑器来做这个修改。

如果我在 eclipse 中更改文件,那么它不会反射(reflect)在浏览器中。

我需要做什么才能对我起作用?

最佳答案

如果您只想在 Eclipse 中热部署,请尝试执行以下步骤:

  1. 双击 Tomcat 插件,引用发布选项卡,确保选中资源更改时自动发布。这应该是默认选项,以支持“热部署”资源,例如:JSP、XML 和属性文件。 enter image description here enter image description here

  2. 在 Tomcat 插件页面中,单击模块 View ,确保自动重新加载已禁用。默认启用。 enter image description here

    Note: This is an important step, failed to set the auto reload to disabled, the Tomcat server will be restarted every time you modified something!

  3. 以 DEBUG 模式启动项目。仅在 DEBUG 模式下支持热部署。

Limitation Hot deploy has supported the code changes in the method implementation only. If you add a new class or a new method, restart is still required.

To simulate it, try to add a new method, following pop up screen will be displayed, saying the code changes cannot be hot swapped in the JVM.

关于eclipse - 如何使 eclipse + tomcat 即时部署 webapps,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37608146/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com