Grails 1.1 Released |
|

Hot on the heels of the Groovy 1.6 release, we are pleased to announce that Grails 1.1 final is out and available from the Grails site. There are numerous improvements that are listed in detail in the release notes. However, some of the key ones are:
Standalone GORM: It is now possible to use Grails' ORM layer (built on Hibernate) outside of Grails. There is an example that uses GORM inside a Spring MVC application in the samples/petclinic-mvc directory of the distribution. The example configures a GORM enabled SessionFactory using Spring as follows:
<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>
Maven & Ant+Ivy Support: Grails applications can now be built with the two most prominent build tools in the Java space. Integrating Grails applications into your Java eco-system just got a lot easier and Grails now covers integration with Java across the whole application life-cycle from build to deployment.
Better Plugins: A crucial part of the Grails experience is the plugin eco-system, and now with Grails 1.1 that experience just got a lot better. Plugins are now installed automatically from project metadata, installs occur transitively (meaning plugin depencencies are automatically installed) and support has been added for global plugins (plugins that span multiple applications).
Spring Namespace Support: As well as supporting Spring's native XML for defining new beans, Grails also supports a 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)"
}
}
}
}
JSP Tag Library Support: It is now possible to use any JSP tag library inside GSP making it even easier to migrate to Grails today. You can even use standard Spring MVC tag libraries with Grails (which is built on Spring MVC):
<%@ 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>
There are many other features and improvments beyond those covered here. It is worth taking a tour through the release notes for a lengthier overview of the highlights.
These are exciting times for Groovy, Grails and Spring, and if you want to hear more you should come along to SpringOne Europe and/or gr8conf, both of which provide ample coverage of Groovy and Grails.
Similar Posts
- Grails 1.3 Released
- First Grails Release Under the SpringSource Banner
- Yet Another Flavour of GORM: MongoDB
- Announcing GORM for Redis
- Web Development Evolved: Grails 2.0 Released!





AlexanderKl says:
Added on March 11th, 2009 at 5:28 amCongratulations on release!
Very nice staff!
GORM standalone works perfectly!
But when I tried to get rid of xml configuration by means of new BeanBuilder:
bb.beans {
. . .
gorm {
sessionFactory("base-package":"org.grails.samples",
"data-source-ref":"dataSource",
"message-source-ref":"messageSource") {
hibernateProperties: [
"hibernate.hbm2ddl.auto": "create",
"hibernate.show_sql": "true"
]
}
}
}
I found that hibernateProperties are not propagated to gorm:sessionFactory.
Is it namespace support laking something or my DSL description is incorrect?
Thank you,
Alexander
AlexanderKl says:
Added on March 11th, 2009 at 7:13 amWorks fine if to rewrite like this:
bb.beans {
. . .
hibernateProperties(String, """
hibernate.show_sql=true
hibernate.hbm2ddl.auto=create
""")
gorm {
sessionFactory(
"base-package":"org.grails.samples",
"data-source-ref":"dataSource",
"message-source-ref":"messageSource") {
property(name:"hibernateProperties", ref:"hibernateProperties")
}
}
}
Dramil says:
Added on March 12th, 2009 at 1:17 amHi Grocher,
It was really nice using the grails 1.1 stable version.
Well while doing my webflow integration test flow test cases i am facing a issue of ViewSelection found as Null. Can you please look into it?
Issue we are facing: In webflow testing their is method named “startFlow()� (A method of Abstract Class grails.test.WebFlowTestCase) which should ideally return the “ViewSelectionObject� (as per http://grails.org/Webflow)
But the method is void so it returns the Null Object. So the test case gets failed as it fails to get the view name for executing the next event.
Is this bug in 1.1 or any patch/fix is available.
Thanks, Dramil.
Dramil says:
Added on March 12th, 2009 at 1:19 amYou can also reach me on dramil@softwebsolutions.com !!!
Thanks in advance !!!
Viraf Karai says:
Added on March 12th, 2009 at 1:03 pmFantastic work, Graeme. Please accept my warmest wishes. I'm really looking forward to designing solutions with Grails 1.1 and beyond. Please keep the component architecture choices limited to Spring and Hibernate with Spring MVC for the web tier. Java EE applications have spun out of control with the massive flexibility offered on the web tier (Spring MVC, Tapestry, JSF, Wicket, Shale, Stripes, Struts, etc.) and the persistence tier (JDBC (with and without Spring), JDO, iBatis, JPA, Hibernate, etc). Who wants this level of complexity? Things can be totally different when moving from one client site to another. I hope Grails keeps the architecture choices limited as they are today. It's truly a pleasure to design and build applications with Grails. Keep up the great work!
cinmpls says:
Added on March 12th, 2009 at 7:56 pmOk, when 1.0.4 came out I had to post that upgrading was nothing more than a nightmare so now that 1.1 it out I find myself needed to post and take a 180 and say that upgrading was very smooth this time around. Congrats on the release and making things easy!
Markus Jais says:
Added on March 13th, 2009 at 3:41 amGreat. I just god your new book on Grails. The first impression of the book is very good. I am sure I will enjoy reading it.
grocher (blog author) says:
Added on March 13th, 2009 at 4:24 amThanks for all the positive feedback guys, I have been at QCon so sorry for the late responses.
@Dramil Feel free to report a JIRA at http://jira.codehaus.org/browse/GRAILS or maybe post what your issue is on the mailing list. However, one thing to note is that Web Flow in Grails 1.1 is based on Web Flow 2.0.3 which had significant API changes (especially in testing) over Web Flow 1.0
@AlexanderKl In your first example:
hibernateProperties: [
"hibernate.hbm2ddl.auto": "create",
"hibernate.show_sql": "true"
]
This should be:
hibernateProperties = [ // notice the equals here
"hibernate.hbm2ddl.auto": "create",
"hibernate.show_sql": "true"
]
Shantha kumar says:
Added on April 12th, 2009 at 12:33 pmUnfortunately doesn't work with JSF still see the Classloader Issue.
Cannot load FacesContextFactory. Though the required jar files are present with the respective Listener entries in web.xml. Not really Sure why this happens. Remove gorm:sessionFactory then JSF Works. Remove the JSF Servlet in web.xml then Gorm works. But Either way doesnt solve my problem.
Have been using Jsf 1.2 with Richfaces.
PS: How ever if we Use the Grails plugin with a Grails Project and Grails Build it works really cool. Except that the error messages are not displayed in the JSF Page, based on the gorm constraints. Not Sure how to Achieve this.
Thanks,
SK
Shantha Kumar
sk@javainxs.com
Shantha kumar says:
Added on April 12th, 2009 at 12:53 pmUnfortunately JSF Still has the class loader issue with gorm:sessionFactory, Clearly telling class not found for FacesContextFactory.
However if we remove gorm:sessionFactory then JSF Works. If we remove the Faces Servlet entry from web.xml then Gorm works. But both dont work with each other atleast with this Configuration.
PS: Using grails with the JSF Plugin works, except the gorm constraints getting reported as JSF Validation Errors.
thanks,
Shantha Kumar