There is DWR which satisfies my needs in Java. I'm interested if there is any Groovier way to do the same thing - with convention over configuration, dynamic method invokation, etc.
views:
339answers:
2
+1
Q:
Is there a way to call server side Groovy object method from client side JavaScript code via AJAX?
+3
A:
I don't think there is such framework at the moment. In the mean time, you may try using Groovy objects with DWR.
Or if you're going to use Grails, you may have a look at Grails DWR plugin: http://grails.org/DWR+Plugin
And this one is an unofficial update for DWR 3: http://www.nabble.com/Updated-DWR-Plugin-for-DWR-3-td21421849.html
chanwit
2009-02-16 22:55:42
+1
A:
I would recommend looking into Grails. The content negotiation feature can be used to return Groovy objects from grails controllers in different formats (xml, json, etc.) and you can consume the JSON on the client side. It literally just takes a few lines of code from a grails controller to return HTML, JSON and XML representations of your objects.
John Wagenleitner
2009-02-17 00:22:22