在开发程序的时候热加载是非常有帮助的,这能大大简化我们开发调试的速度。在使用tapestry开发的时候,只要是启动了调试模式,那么代码的热替换是自动被JVM支持的,也就是只要我们的tapestry运行在调试模式下,就可以实现java代码的即时修改即时生效。但是tapestry的页面文件(.page和.html模板)默认是无法实现热加载的,每次修改页面都必须重启服务器,大大降低了开发速度。其实解决这个问题只要增加虚拟机参数就可以了,只要在虚拟机参数(注意不是应用参数)中加入:-Dorg.apache.tapestry.enable-reset-service=true -Dorg.apache.tapestry.disable-caching=true即可。这样每次修改的时候tapestry就不会去缓存中取了,其中org.apache.tapestry.enable-reset-service的意思是:If not specified as "true", then the reset service will be non-functional. The reset service is used to force the running Tapestry application to discard all cached data (including templates, specifications, pooled objects and more). This must be explicitly enabled, and should only be used in development (in production, it is too easily exploited as a denial of service attack).
Unlike most other configuration values, this must be specified as a JVM system property.