简体   繁体   中英

How to implement REST controller in grails

I used to do Grails applications where controllers return some model to the view. Now, I have to create the REST web service, which will accept and return the data in JSON or XML format. I want to map it to some URL resource as well.

Please give me some bits of advice (plugins, the code snippets)

Thanks in advance

Read up on the grails restful api plugin

http://grails.org/plugin/restful-api

It is very thorough and well documented

Or, if you just want a simple REST api, you can use the built in method for return json from your controller.

http://grails.org/doc/2.2.1/guide/webServices.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM