Grails1.2 新特性

Grails 1.2 馬上出來了,現在是M4

介紹一下新特性(部分):


[b]改用tomcat,jetty可選[/b]
如要換回jetty
grails uninstall-plugin tomcat
grails install-plugin jetty


[b]web flow 移出,到插件[/b]
如要使用
grails install-plugin webflow


[b]bootstrap 可配置不同env[/b]
def init = { ServletContext ctx ->
environments {
production {
ctx.setAttribute("env", "prod")
}
development {
ctx.setAttribute("env", "dev")
}
}
ctx.setAttribute("foo", "bar")
}


[b]升級spring3 [/b]

[b]提供GORM 默認設置[/b]
grails.gorm.default.mapping = {
cache true
id generator:'sequence'
'user-type'( type:org.hibernate.type.YesNoType, class:Boolean )
}

默認約束:
grails.gorm.default.constraints = {
'*'(nullable:true, blank:false, size:1..20)
}


[b]支持maven jar指定[/b]
grails.project.dependency.resolution = {
inherits "global" // inherit Grails' default dependencies
repositories {
grailsHome()
mavenCentral()
}
dependencies {
runtime 'com.mysql:mysql-connector-java:5.1.5'
}
}
發佈了16 篇原創文章 · 獲贊 0 · 訪問量 2802
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章