我得到了一个 Struts 项目的模板,我注意到当我在 Eclipse 中的集成 Tomcat 上运行 Web 项目并更改 .jsp View 页面时,它们不会在几秒钟后自动重新加载- 这确实发生在我自己制作的其他项目中。
所以我认为这是一个配置问题,我做了一些研究,我查看了我的 Tomcat 服务器设置:
(x) Automatically publish when resources change (1 second interval)
但是因为我自己的项目重新加载并且我为它们使用相同的服务器,所以我认为这一定是应用程序特定的问题。
所以我查看了 context.xml
看看这里是否有什么需要改变的
<Context
...
reloadable="true"
...
>
我只能假设告诉服务器确实在更改时重新加载应用程序。
所以我实在想不通。在我看来,这里一切都井井有条。我错过了什么?
最佳答案
来自关于 Context attributes 的 Apache Tomcat 文档:
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.
也许这对您来说很有趣:Using Tomcat Reload Features To Speed Up Development
关于eclipse - 让 Eclipse 自动重新加载我的 Java Web 应用程序中的 JSP 页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14259134/