升级到Grails0.5的注意点以及g:richTextEditor的一个patch和messages_zh_CN.properties的一个patch

升级到Grails0.5的注意点以及g:richTextEditor的一个patch和messages_zh_CN.properties的一个patch
升级到Grails0.5需要注意:
将GRAILS_HOME\lib\groovy-starter.jar复制到GROOVY_HOME\lib下,由于Groovy1.1的jar文件有些改动,原本GROOVY_HOME\lib\groovy-starter.jar中的class文件被打包进了groovy-all-1.1<*>.jar,所以导致无法启动。

官方README中的注意点:
There are some unavoidable issues that may affect you when upgrading to 0.5 from a previous version:

1. If you have an old default index.jsp, it will not function correctly due to a change in a property name. Remove the file if you have not customized it, or change the reference to the "controllers" property to "controllerClasses"

2. Your custom taglibs that call other tags will need to be changed. Tags called from within a tag now return a string containing the content instead of writing to out, so you must do something like:

   out << theOtherTag(attrs)

3. Your taglibs, if they call their own non-tag closures as if they are methods, will not function correctly if the closure has less than 3 arguments. Change such code to:

   yourClosureName.call(args)

4. Tag bodies return strings instead of writing to out, so you must change code that calls body() to:

   out << body()

5. View loading mechanisms have changed, so if you need to load a view directly or check for its existence, you must now use a resource loader:

   def resourceLoader = ctx.containsBean('groovyPageResourceLoader') ?
        ctx.groovyPageResourceLoader : ctx
   def resource = resourceLoader.getResource(uri)

   if(resource && resource.file && resource.file.exists()) {
      ...   
   }

6. Note the deprecation warnings you see in your console, these need to be tackled prior to 0.6 where these old features will be removed.


各位正在使用Grails0.5的朋友,如果用到了g:richTextEditor这个标签,则请用附件中的UITagLib.groovy替换grails-0.5\src\grails\grails-app\taglib\UITagLib.groovy,否则无法显示内容,如果您已经在进行开发,请同时替换<your project name>\plugins\core\grails-app\taglib\UITagLib.groovy。

我已经提交了patch,有急需的朋友可以现在就下载。

点击下载


Grails0.5的messages_zh_CN.properties的编写有问题,我已经修正,否则显示的内容为乱码:

点击下载



附: 朝花夕拾——Groovy & Grails

你可能感兴趣的:(升级到Grails0.5的注意点以及g:richTextEditor的一个patch和messages_zh_CN.properties的一个patch)