在開發(fā)程序的時候熱加載是非常有幫助的,這能大大簡化我們開發(fā)調(diào)試的速度。在使用tapestry開發(fā)的時候,只要是啟動了調(diào)試模式,那么代碼的熱替換是自動被JVM支持的,也就是只要我們的tapestry運行在調(diào)試模式下,就可以實現(xiàn)java代碼的即時修改即時生效。但是tapestry的頁面文件(.page和.html模板)默認是無法實現(xiàn)熱加載的,每次修改頁面都必須重啟服務(wù)器,大大降低了開發(fā)速度。其實解決這個問題只要增加虛擬機參數(shù)就可以了,只要在虛擬機參數(shù)(注意不是應(yīng)用參數(shù))中加入:-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.