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
Post a Comment