How to use Command Object on Controller (Grails 2.3.11) for update? -


for example, have controller 'addresstestcontroller', , has function update accepts command object.

addresstestcontroller {     def update(addressupdatecommand cmd){} }  class addressupdatecommand {     string firstname     string address } 

when 'firstname' not in body request, it's null. when has value null, it's null. how check if user wants value null? thanks

afaik can't differ between empty , not submitted values in command.

the difference be, default values should applied if value not submitted.

class addressupdatecommand {     string firstname = "firstname not submitted"     string address } 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -