logo
Currently Browsing: Grails
Apr
12

Exploring the Grails Cache Plugin: Evicting Multiple Caches

Exploring the Grails Cache Plugin: Evicting Multiple Caches 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,...
Jan
30

A Lesser Known Grails Tag: g:external

A Lesser Known Grails Tag: g:external 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...
Nov
2

Testing UrlMappings params in Grails

Testing UrlMappings params in Grails 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 =...
Oct
22

Grails Scratcher of the Day: Global GORM Constraints

  Ok. So the title tells you something, but it might not get you through this scratcher. Here’s the domain class that we’re working with: package constrainme class Book { String title String author static constraints = { title blank: false author blank: false } }   Now let’s imagine we want to make sure those constraints are working...
Oct
5

Grails, Floating Point Precision, Migrations and Double Trouble

Grails, Floating Point Precision, Migrations and Double Trouble 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...

« Previous Entries

logo
Powered by WordPress | Designed by Elegant Themes