Using grails 2.3.7. I am trying to use Grails controller action parameter binding. If I have this code:
class TestController {
def test(MyClass1 myClass1) {
log.debug(myClass1)
}
}
myClass1 is correctly fetched from DB using http://locahost:8080/myapp/test/test/1.
But now I want to pass two domain classes. I have tried this code:
class TestController {
def test(@RequestParameter('obj1') MyClass1 myClass1,
@RequestParameter('obj2') MyClass2 myclass2) {
log.debug(myClass1)
log.debug(myClass2)
}
}
And access using http://localhost:8080/myapp/test/test?obj1.id=1&obj2.id=3, nothing is fetched. Is this the right way to use data binding in controller actions? Or is this impossible?
Regards and thanks in advance.