简体   繁体   English

为什么每次更改/编辑 java servlet 代码时都需要重新启动 Tomcat Apache 服务器

[英]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.

相关问题 每次更改资源时都需要重新启动服务器吗? - do I need to restart the server every time i change a resource? 我是否需要为每个jsp或java更改重新启动tomcat的所有内容? - Do I have to restart tomcat everything for every jsp or java change? 我必须每天早上重新启动tomcat服务器才能恢复我的网络服务 - I have to restart my tomcat server to resume my webservice every morning 如何在Apache Tomcat服务器中保护代码? - How can I secure my code in an Apache Tomcat Server? 每当我在java文件中编辑时,我都必须重新启动apache服务器以将这些更改应用到类文件中 - Whenever i edit in java file , i have to restart apache server for apply those changes in class file 对于每个代码更改,都需要导出war并重新启动服务器 - For every code change need to export the war and restart the server 每当我添加新的servlet时Tomcat就会停止工作 - Tomcat stops working every time i add a new servlet Java | Apache Tomcat | 捕获异常并重新启动服务器 - Java | Apache Tomcat | Grab Exception and Restart the server Tomcat更改javascript文件无需重启服务器 - Tomcat change javascript file no need to restart server 每次更改代码中的内容时都会发生java.lang.ClassNotFoundException(Neo4j OGM + Play!) - java.lang.ClassNotFoundException Every time I change something in my code (Neo4j OGM + Play!)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM