Java – why doesn’t Tomcat need to restart when JSP changes

I've been using JSP, servlet I know that as long as we change anything in the servlet, we need to restart Tomcat server to get the changes Tomcat does not need to be restarted in case of JSP changes

According to my knowledge, JSP pages are converted to servlets only at compile time Therefore, it is completely a servlet So, how does Tomcat work without a reboot

I know that a JSP page is compiled, just like the first visit after the server restarts

Solution

Because by default, Tomcat starts in development mode, which means that the JSP derived servlet is recompiled when changes are detected This is a good question about how the JVM loads new classes - perhaps the Tomcat class loader is configured to do so

Several related notes:

>You can turn off the development option for production > you can reload the servlet, and you must start Tomcat with JVM in debug mode

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>