web-services - 在浏览器刷新时编译 JSP 和 Java - Tomcat

标签 web-services jsp tomcat tomcat7

有什么方法可以设置 Tomcat 服务器,以便每当我对 Java 类或 JSP 页面进行更改时,更改在浏览器刷新时可见。
我厌倦了停止和启动 Tomcat。我想像 WAMP 的工作方式一样配置 Tomcat [您可以在浏览器刷新时看到 PHP 代码更改]

最佳答案

如果它是用于开发模式就可以了。不要将它用于生产内容。

  • 您不必重新启动服务器。您可以通过 Tomcat Manager 重新启动应用程序。

  • 您甚至可以直接这样做:http://[hostname]:[port]/manager/reload?path=[/path/to/your/webapp]

  • 将您的上下文定义为可重新加载

注意:不建议将元素直接放在 server.xml 文件中 查看 Tomcat 配置指南

对于 java 类:可重载

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. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.

NOTE - The value for this property will be inherited from the reloadable attribute you set on the surrounding Context component, and any value you explicitly set here will be replaced. (http://tomcat.apache.org/tomcat-7.0-doc/config/loader.html)

对于 JSP:开发 ($CATALINA_BASE/conf/web.xml)

development - Is Jasper used in development mode? If true, the frequency at which JSPs are checked for modification may be specified via the modificationTestInterval parameter.true or false, default true.

希望对你有帮助

关于web-services - 在浏览器刷新时编译 JSP 和 Java - Tomcat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11919804/

相关文章:

wcf - WCF 中的 'by ref' 参数是好是坏?

java - 使用 ExtJS 进行页面重定向/刷新

html - 如果它已经在浏览器中打开,如何打开同一个选项卡的 url

java - Tomcat 和 Matlab 编译器运行时内存不足错误

java - 无法从 IntelliJ IDEA 12.1.4 Ultimate (Windows 7) 启动 Apache Tomcat 6

android - Web服务替代

WCF - 如何接受长字符串作为参数

web-services - Portlet 和 Web 服务之间的区别

java - 如何修复页面上的 '�' 符号?这似乎是 servlet 和 Javascript 之间发生的事情。

tomcat - 带有 Tomcat 7 的 UrlRewriteFilter