Locate the Server.xml file in the Conf file in the installation directory of Tomcat and add it to the <Host> node.
<context docbase= "Engineering physical path" path= "/Project Name" reloadable= "true" source= "Org.eclipse.jst.j2ee.server: Project name"/>
For example, for development project test: Add
<context docbase= "D:/tomcat/tomcat-7.0.4/test" path= "/test" true "reloadable=" Org.eclipse.jst.j2ee.server:test "/>
Save the file, write a System.out.println ("haha") in the background class file of test, start Tomcat, after printing, modify the print content, but do not restart Tomcat, found that it really printed out new content;
A little bit of trouble is that every time you develop a project you have to modify the configuration file, but it's much more convenient to restart it than to change a class each.
It is important to note that if you remove the item from Tomcat, you must also remove the configuration, otherwise the startup server will not be able to find the wrong test item. --------
Modify
%tomcat_home%\conf\server.xml
roughly as follows:
<context path= "" docbase= "ROOT" debug= "0" reloadable= " True "/>
1.path back write <url-pattern> inside the path, docbase write your Web application name. For example, your catalogue tomcat/webapp/testapp. So Docbase wrote the/TESTAPP2. Once the MyEclipse is installed, the server automatically reload when the servlet is specified, and after you modify it
==============================================
How can you continue to debug after you modify a Java class file without restarting the server or redeploying the project? Of course, there is a prerequisite, it is not possible to modify the method name or number of parameters, otherwise it must be restarted.
Modify the context label in%tomcathome%\conf\context.xml as follows:
<context reloadable= "true" >
</Context>
///////////////////////////////////////////////////////
It was later found that the original settings were simple, and the MyEclipse settings for Tomcat were only required to add the following settings to the JDK's optional Java VM arguments:
-xms256m-xmx512m
-dcom.sun.management.jmxremote=true <!--startfragment-->
The first line is to set Tomcat memory, which changes according to individual circumstances,
The actual meaning of the second line is actually not very clear to me, however, after adding this line, modifying the Java class file to continue debug when the service is not restarted is a great help to the relatively large programmers, because the project often takes several minutes to restart. And sometimes because some settings need to be repeated debugging. ===========================================
At the company, it's always strange why some colleagues can change a class implementation without restarting Tomcat to deploy new changes, while others cannot.
The configuration of the system and MyEclipse was compared with each other, and the result was that even the same configuration was not used.
It was only recently discovered that the original problem is the difference in starting the service, some people use MyEclipse to start Tomcat using the run mode, while others are using the debug mode, and then found the problem, MyEclipse will remember the last start service mode, And then every time you start the default is to start the service with the last mode, so we have the same configuration, the same as the operation (using the toolbar's Startup button [default]), there will be different results.
In fact, just starting the Tomcat service in debug mode enables MyEclipse to automatically deploy changed classes.
Modify startup mode to enter Window->show view to open the Servers Views panel, and then right-click the tomcat using Run Server/debug Server to start.
Note: The debug mode cannot update this change when code outside the method (method name/Parameter/class modification) is modified, and MyEclipse automatically prompts for the need to restart the service
=======================================
To modify Tomcat configuration files
Locate the service path where Tomcat is deployed (for example: D:\Tomcat6.0\apache-tomcat-6.0.36\conf), explaining that the Tomcat path is the deployment server path that runs the project.
In the Conf folder to find Server.xml file changes inside the reloadable=true for Reloadable=false;
The Reloadable property belongs to the <context/> label properties of the deployment project.
For example: <context debug= "0" docbase= "D:\JavaCode\E-bsoft\CDCPro\WebRoot" path= "/cdcpro" reloadable= "false"/>