Skip to content

Instantly share code, notes, and snippets.

@qfrank
Last active September 1, 2015 13:01
Show Gist options
  • Save qfrank/2d2b59ee3b71255b25d2 to your computer and use it in GitHub Desktop.
Save qfrank/2d2b59ee3b71255b25d2 to your computer and use it in GitHub Desktop.
grails url-mappings-report
// test com.xx.PushServiceSpec
test-app unit: **.Push*
// specify service init non-lazy, just add a static lazyInit property with false
static lazyInit = false
import org.grails.databinding.converters.ValueConverter
import test.Address
class AddressValueConverter implements ValueConverter {
boolean canConvert(value) {
value instanceof String
}
def convert(value) {
def pieces = value.split(':')
// uncomment following line will make convert failed..but exception won't display in ide console!
// throw new RuntimeException('convert failed')
return new Address(city: pieces[0], state: pieces[1])
}
Class<?> getTargetType() {
Address
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment