17th May 2010
Further information about the release can be obtained using the links below:
Filter Ordering
The order in which filters are executed may now be influenced by expressing that a filter depends on some number of other filters.
class MyFilters {
def dependsOn = [MyOtherFilters]
def filters = {
...
}
}
class MyOtherFilters {
def filters = {
...
}
}
GSP Tag "unless"
A new GSP tag has been provided called "unless", which acts as a counterpart to the existing "if" tag.
<g:unless test="${cacheEnabled}">
Tag Body Goes Here
</g:unless>
Improved Query Caching
The findAll query method now supports taking advantage of the 2nd level cache.
Book.findAll("from Book as b where b.author=:author", [author:'Dan Brown'], [cache: true])
Nested Named Queries
Named queries may now be nested.
class Publication {
String title
String author
Date datePublished
Integer numberOfPages
static namedQueries = {
recentPublications {
def now = new Date()
gt 'datePublished', now - 365
}
publicationsWithBookInTitle {
like 'title', '%Book%'
}
recentPublicationsWithBookInTitle {
// calls to other named queries...
recentPublications()
publicationsWithBookInTitle()
}
}
}
TagLib Testing
TagLibUnitTestCase
now supports testing custom tags that access the dynamic pageScope
property. The pageScope property is now dynamically added to tag libraries at test time.