Tomcat uses spring-loaded for hot Application Deployment. springloadedtomcat
Springloaded official notes:
Spring Loaded is a JVM agent for reloading class file changes whilst a JVM is running. it transforms classes at loadtime to make them amenable to later reloading. unlike 'hot code replace 'which only allows simple changes once a JVM is running (e.g. changes to method bodies), Spring Loaded allows you to add/modify/delete methods/fields/constructors. the annotations on types/methods/fields/constructors can also be modified and it is possible to add/remove/change values in enum types.
Spring Loaded is usable on any bytecode that may run on a JVM, and is actually the reloading system used in Grails 2.
1. Download springloaded-1.2.5.RELEASE.jar, address: https://github.com/spring-projects/spring-loaded
2. Place the springloaded-1.2.5.RELEASE.jar in the bin folder of tomcat
3. open catalina. bat in bin and add the following sentence:
Set JAVA_OPTS =-Java agent: springloaded-1.2.5.RELEASE.jar-noverify