O'Reilly logo

Spring Roo 1.1 Cookbook by Ashish Sarin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding JSON support to domain objects and controllers

Let's say that you have developed the persistence layer of your application using Roo. Now, you want to expose the CRUD operations and dynamic finder methods defined in the Roo-generated JPA entities to the outside world via a RESTful interface.

Roo supports exposing CRUD operations and dynamic finders of JPA entities via RESTful interfaces that use JSON documents for exchanging data. As JSON is used by Roo-generated RESTful interfaces, you can modify JSPX pages of the Roo-generated Spring Web MVC application to use Ajax to interact with these RESTful interfaces.

Roo provides two commands for adding JSON support to existing classes in the Roo project:

  • json add: Adds JSON support to the class specified ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required