grails: how to change compiled GSPs (gsp*.class files)?

旧时模样 提交于 2019-12-14 02:06:53

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!