0
votes

I'm quite new to Grails things. here the problem:

I created a simple class exposed as a REST service with grail. (I only use grail for CRUD operation on database).

I have an Java FX application that needs to consume this service to recreate the original object. Is there a clean way to "export" domain class from grails ?

Thx in advance for any help !

3

3 Answers

1
votes

You can create common java library for both projects, include in Grails app and JavaFX app. This common library will share common classes. For marshalling/demarshalling JSON you can use Jackson

0
votes

GSON or Jackson will do what you want.

0
votes

Take a look at http://grails.org/doc/latest/guide/webServices.html#domainResources.

For example, if you are returning a "book" domain class from your REST service you could use:

render book as JSON