Menu
  • HOME
  • TAGS

RestfulController not binding nested JSON in POST

grails,grails-2.4

After much discussion with the grails dev team I've been informed that my understanding of how this should work is not the way Grails works. I assumed (incorrectly) that because the data binding added the TaskFilter to the Task that it would behave as if addToFilters() was called on the...

How to get Authenticated with spring security rest plugin in Grails

rest,grails,spring-security,grails-plugin,grails-2.4

Try this $.ajax({ url: " http://localhost:8080/AppName/api/login", type: "POST", crossDomain: true, data: JSON.stringify({"username":"yourusername" , "password":"yourpassword"}), contentType: 'application/json; charset=utf-8', dataType: "json", success: function (response) { console.log(response); }, error: function (xhr, status) { alert("error"); } }) }); ...

Grails 2.4.4 Dynamic One-to-Many Forms

grails,gorm,grails-2.4

static constraints = { deleted bindable: true } ...

@Resource is creating controller that shadows my own controller

grails,hateoas,grails-2.4

Use namespaces for your controller. class BookController { static namespace = 'namespaceOne' // … } and then use the namespace to generate links to your BookController. <g:link controller="book" namespace="namespaceOne">Click me</g:link> ...

How to write a spock unit test case for traits in grails 2.4?

unit-testing,grails,spock,traits,grails-2.4

Groovy's type coercion can be used to add behaviours from a trait to a class at runtime. class MyTraitSpec extends Specification { @Shared MyTrait testInstance = new Object() as MyTrait // ... } You should be aware that this creates a proxied instance, although the documentation (http://beta.groovy-lang.org/docs/groovy-2.3.0/html/documentation/core-traits.html#_runtime_implementation_of_traits) says the proxy...

How to update a server side datatable on change a checkbox from outside of datatable

grails,datatables,datatables-1.10,grails-2.4

In your DataTables initialization code you need to use option fnServerParams to modify data sent to the server. I have also corrected deferLoading which should be iDeferLoading, see iDeferLoading. Below is modified DataTables initalization code: $('#example').dataTable({ "sPaginationType": "full_numbers", "bAutoWidth": true, "bServerSide": true, "iDisplayLength": 10, "iDeferLoading": ${totalCount?:0}, "sAjaxSource": "${g.createLink(controller: 'androidGame',action: 'ajaxAndroidGameList')}",...