升級到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