Skip to content

Instantly share code, notes, and snippets.

@abhaytalreja
Created September 26, 2013 23:36
Show Gist options
  • Save abhaytalreja/6722120 to your computer and use it in GitHub Desktop.
Save abhaytalreja/6722120 to your computer and use it in GitHub Desktop.
This is just a simple file for type conversions in Grails.
class SimpleController {
def submit = {
def intValue = params.int('paramInt')
def shortValue = params.short('paramShort')
def byteValue = params.byte('paramByte')
def longValue = params.long('paramLong')
def doubleValue = params.double('paramDouble')
def floatValue = params.float('paramFloat')
def booleanValue = params.boolean('paramBoolean')
[ intValue: intValue, shortValue: shortValue,
byteValue: byteValue,
longValue: longValue, doubleValue: doubleValue,
floatValue: floatValue, booleanValue: booleanValue ]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment