在Spring官方網站閑逛,發現Grails 1.1在 2009-03-12正式發布了.
主要新加入的功能特征:
1. Standalone GORM.(可脫離Grails框架單獨運行)
<gorm:sessionFactory base-package="org.grails.samples"
data-source-ref="dataSource"
message-source-ref="messageSource">
<property name="hibernateProperties">
<util:map>
<entry key="hibernate.hbm2ddl.auto" value="update"/>
</util:map>
</property>
</gorm:sessionFactory>
data-source-ref="dataSource"
message-source-ref="messageSource">
<property name="hibernateProperties">
<util:map>
<entry key="hibernate.hbm2ddl.auto" value="update"/>
</util:map>
</property>
</gorm:sessionFactory>
2. Maven & Ant+Ivy Support(Grails項目可以通過Maven和Ant Ivy編譯)
3. Better Plugins (更好的插件實現,支持通知項目的metadata文件進行安裝)
4. Spring Namespace Support
Groovy DSL for defining bean definitions. This DSL has been extended to support Spring namespaces:
beans = {
xmlns aop:"http://www.springframework.org/schema/aop"
fred(Person) {
name = "Fred"
age = 45
}
birthdayCardSenderAspect(BirthdayCardSender)
aop {
config("proxy-target-class":true) {
aspect( id:"sendBirthdayCard",ref:"birthdayCardSenderAspect" ) {
after method:"onBirthday",
pointcut: "execution(void ..Person.birthday()) and this(person)"
}
}
}
}
beans = {
xmlns aop:"http://www.springframework.org/schema/aop"
fred(Person) {
name = "Fred"
age = 45
}
birthdayCardSenderAspect(BirthdayCardSender)
aop {
config("proxy-target-class":true) {
aspect( id:"sendBirthdayCard",ref:"birthdayCardSenderAspect" ) {
after method:"onBirthday",
pointcut: "execution(void ..Person.birthday()) and this(person)"
}
}
}
}
5. JSP Tag Library Support JSP標簽庫支持
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<form:form commandName="address" action="do">
<b>Zip: </b><form:input path="zip"/>
</form:form>
<form:form commandName="address" action="do">
<b>Zip: </b><form:input path="zip"/>
</form:form>
下面是官方發布信息:
SpringSource Head of Grails development, Graeme Rocher, provides an overview of the new features in his latest blog post. This includes the much requested ability to use Grails' Object Relational Mapping (GORM) outside of Grails itself as well as an example that uses GORM inside a Spring MVC application. Incorporating Spring namespaces and support for popular build tools like Maven and Ant+Ivy, the new release is the perfect opportunity to take a look at Grails.