Whats is the advantage of using respond() over render() in grails 2.xxx ?
I found respond() when I tried to generate the controller and views of a domain.
like in create() it has code like :
respond new DomainObject(params);
also I found request.withFormat(), a little bit strage to me
droppingInstance.save flush:true;
request.withFormat {
form multipartForm {
flash.message = message(code: 'default.created.message', args: [message(code: 'dropping.label', default: 'Dropping'), droppingInstance.id])
redirect droppingInstance
}
'*' { respond droppingInstance, [status: CREATED] }
}
I read the doc already but found no clue about multiplatform etc ... http://grails.org/doc/latest/ref/Controllers/request.html http://grails.org/doc/latest/ref/Controllers/respond.html
also why not using redirect to display the data ?
could someone explain both methods please ? :)