grails:如何更改已编译的GSP(gsp * .class文件)? [英] grails: how to change compiled GSPs (gsp*.class files)?

查看:156
本文介绍了grails:如何更改已编译的GSP(gsp * .class文件)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在weblogic中使用grails,需要在展开的deploy文件夹中更改类文件。
但是这个类实际上是一个gsp编译文件。



所以,问题是:GSP文件(.class)在哪里停留在战争中?



注意:我使用外部GSP,在Config.groovy文件中设置 grails.gsp.view.dir 从Grails 1.3.5开始,你只需在Config.groovy中设置grails.gsp.enable.reload = true,或者在Config.groovy中设置grails.gsp.enable.reload = true,或者设置系统属性-Dgrails.gsp.enable.reload = true以启动应用程序服务器(tomcat等)。



在战争部署模式下的GSP重新加载已被打破Grails 2.0M1和M2构建(GRAILS-8189)。它在主分支中被修复,并将在2.0RC1中发布。预编译的gsps的GSP重新加载仅适用于1.3.x分支中的1.3.5-1.3.7。对于1.2.x,没有支持。



视图文件(用于预编译的GSP类的GSP源代码)位于WEB-INF / grails-app / views目录下在展开的部署目录中。更改会在10秒内完成(检查时间间隔默认为5秒)。



如果您设置了grails.gsp.view.dir,则文件应该在该目录(手册有更多说明)。只有当您还设置了grails.gsp.enable.reload时,重装仅适用。

手册中有更多信息:
Grails参考文档 - 6.2.6更改已部署的应用程序


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.

解决方案

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 deployed 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 tailing 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:

这篇关于grails:如何更改已编译的GSP(gsp * .class文件)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆