[英]Why I need to restart Tomcat Apache server every time I change/edit my java servlet code
I am coding my basic servlet programs in notepad but every time I make changes in my java file and after compiling it, I need to restart my tomcat apache to see that changes on browser.我在记事本中编写我的基本 servlet 程序,但每次我在 java 文件中进行更改并且在编译它之后,我需要重新启动我的 tomcat apache 以查看浏览器上的更改。 Is there any solution for this as I have to work on project and will need changes frequently.
是否有任何解决方案,因为我必须处理项目并且需要经常更改。 I have tried making service automatic from services manager.
我曾尝试从服务管理器自动提供服务。
The changes made in Servlet/Java code will not reflect itself, we have to re-compile the Java code and again deploy the application to the Tomcat server. Servlet/Java 代码中所做的更改不会反映自身,我们必须重新编译 Java 代码并再次将应用程序部署到 Tomcat 服务器。 Only after these work server will be able to get the modified values.
只有经过这些工作服务器才能获得修改后的值。
If you don't want to do it manually then you can set reloadable="true"
in the context.xml file.如果您不想手动执行此操作,则可以在 context.xml 文件中设置
reloadable="true"
。 Now Catalina (tomcat server) will monitor classes in /WEB-INF/classes/ and /WEB-INF/lib for changes, and automatically reload the web application if a change is detected.现在 Catalina(tomcat 服务器)将监视 /WEB-INF/classes/ 和 /WEB-INF/lib 中的类的更改,并在检测到更改时自动重新加载 web 应用程序。 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.
这就是该属性的默认设置为 false 的原因。 You can use the Manager web application, however, to trigger reloads of deployed applications on demand.
但是,您可以使用 Manager web 应用程序来触发按需重新加载已部署的应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.