grails / grails-core

The Grails Web Application Framework
http://grails.org
Apache License 2.0
2.78k stars 951 forks source link

GRAILS-5787: Allow updating / overriding precompiled GSPs in war-deployed mode ("gsp only reloading" -mode for production) #1646

Closed graemerocher closed 9 years ago

graemerocher commented 14 years ago

Original Reporter: lhotari Environment: Not Specified Version: 1.2 final Migrated From: http://jira.grails.org/browse/GRAILS-5787

Sometimes there is a customer requirement to immediately change some information in a grails gsp file. In war deployed mode, there should be a possibility to update gsps easily while running in production (without full reloading enabled).

Precompiled gsps classes contain the timestamp of the original gsp file in a static field called LAST_MODIFIED. If the override directory is specified it should be checked for an updated version of the gsp file. If the gsp file is newer, it should be used and compiled on the fly. There should be a parameter which defines the interval between checking for new versions of a gsp file (5000ms default).

If the war is deployed in "exploded mode", the default directory for overriding gsps is servletContext.getRealPath("/WEB-INF"). The gsps are in WEB-INF/grails-app/views and WEB-INF/plugins/*/grails-app/views directories by default in war deployed mode.

graemerocher commented 14 years ago

lhotari said: Documentation for new reloading features: http://github.com/grails/grails-doc/commit/9b523bd52cae5cf662c59f6b5f4cfb1baad27d66

graemerocher commented 13 years ago

rvanderwerf said: as far as I can tell, this is not actually working or fixed on 1.3.5. See http://jira.codehaus.org/browse/GRAILS-6959 for more info and a test app.

graemerocher commented 13 years ago

lhotari said: The correct property name to enable GSP reloading is "grails.gsp.enable.reload" . There is a typo in the documentation.

graemerocher commented 13 years ago

lhotari said: TODO: fix documentation.