为什么每次编辑Servlet类时都需要重新启动Tomcat [英] Why do we need to restart Tomcat every time we edit a Servlet class

查看:138
本文介绍了为什么每次编辑Servlet类时都需要重新启动Tomcat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在修改用户定义的Servlet类时,我们需要重新启动Apache Tomcat服务器. 但是,只要我们修改JSP文件,就不需要重新启动.

While we modify a user-defined Servlet class, we need to Restart the Apache Tomcat Server. but Whenever we modify a JSP file, we need NOT Restart.

请任何人告诉我其背后的确切原因.

Please anyone tell me the exact reason behind that..

谢谢.

推荐答案

这是因为Tomcat不支持热代码替换.如果您正在像Eclipse这样的IDE中进行开发,则可以使用 JRebel 插件实现这一目标.截至目前(2019年5月),JRebel仍然没有免费的替代品(主要是因为这确实是不平凡的).

It's because Tomcat doesn't support hot code replacement. If you're developing in an IDE like Eclipse, then you could use among others the JRebel plugin to achieve this. As of now (May 2019), JRebel has still no free alternatives (primarily because this is really non-trivial).

但是有些服务器支持开箱即用的热代码替换,例如 WildFly

There are however servers which support hot code replacement out the box, such as WildFly and Payara. For them JRebel is not needed when you edit existing methods. These servers are out the box capable of performing hot code replacement via JVM hot-swap feature. JRebel is then only needed when you want to add new classes/methods and get them to deploy instantly.

这篇关于为什么每次编辑Servlet类时都需要重新启动Tomcat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆