问题
I'm using grails in weblogic and need to change a class file in a exploded deploy folder. But this class is actually a gsp compiled file.
So, the question is: where GSP files (.class) stay in a war ?
Note: I'm using external GSPs, setting grails.gsp.view.dir
in Config.groovy file.
回答1:
Since Grails 1.3.5, you just have to set grails.gsp.enable.reload = true
in Config.groovy
or set a system property -Dgrails.gsp.enable.reload=true
to the appserver (tomcat, etc.) startup.
GSP reloading in WAR deployment mode has been broken for Grails 2.0M1
and M2
builds (GRAILS-8189
). It's fixed in master branch and will be released in 2.0RC1
. GSP reloading for precompiled GSPs is only available for 1.3.5
- 1.3.7
in the 1.3.x
branch. For 1.2.x
there is no support.
The view files (GSP "source code" for precompiled GSP classes) are under WEB-INF/grails-app/views
directory in the exploded deployment directory. Changes get picked up within 10 seconds (check interval is 5 seconds by default).
If you have grails.gsp.view.dir
set, then the files should be under that directory (manual has more instructions). Reloading only works if you also have grails.gsp.enable.reload
set. There has to be a trailing slash in the grails.gsp.view.dir
property.
There is more information in the manual: Grails Reference Documentation - 6.2.6 Making Changes to a Deployed Application:
来源:https://stackoverflow.com/questions/7840439/grails-how-to-change-compiled-gsps-gsp-class-files