The more recent version of Grails bundle a cute little Cache plugin that abstracts some of the Cache classes built into Spring 3.1. For the common use cases, you can simply make use of the @Cacheable annotation, and then make use of @CacheEvict when you need to clean things out. But this sample code demonstrates what to do when you need to evict several caches on a single method call (for instance,...
Working on refreshing the “tasty views and layouts” chapter for Grails in Action 2.0 and came across the gem that is the g:external tag.
Grails 2.0 introduced this cute little tag called <g:external> for that very common case of linking to CSS, JavaScript and favicons. Back in the old days, you used to use some kind of “resource” link, perhaps as a method call for brevity (or...
I’m busy working on the UrlMappings section of Grails in Action (2nd Edition) and have been discovering a few interesting tidbits that don’t turn up in the docs (at least not that I know of, at time of writing).
One of them relates to testing more complex UrlMapping setups. For instance, here are a couple of interesting examples to get you thinking:
class UrlMappings {
static mappings =...
I can’t remember how I survived before the Database Migration plugin. Being able to deploy upgrades to client site without having to worry about which old version they were previously running is very comforting. It’s the second plugin I install after Spock.
There are a few rough edges that I have encounter with the output of good old dbm-gorm-diff, and always end up doing a little bit of hand...