I have a JSON object in my view page, I pass it via params, lets say 'params.userInfo' and in the controller, I want it to parse to an object 'User' which I have created. How do I do it ? The user object may be such
class User{
string name
string age
}
Thanks in advance
This should work:
def user = new User(params.userInfo)
You can get the information from Grails documentation here: http://grails.org/Converters+Reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With