简体   繁体   中英

What if I create a simple controller in Groovy & Grails and use it as Rest API Controller, other then extending RestFulController?

我使用的是Groovy&Grails,我想要使用正常的Grails控制器作为Rest Controller和使用RestFulController类之间的区别。第二,我想知道到底是Grails使用哪个API实现(Jersey或RestEasy)。

I wanted the difference between using nomal Grails controller as Rest Controller the using RestFulController class.

The difference would depend what you put in your normal Grails controller. If you put the same behavior in your normal controller as is provided by RestfulController , then of course there would be no functional difference. If you did not put the same behavior in your normal controller as is provided by RestfulController , then the details of what you put in your controller will dictate the differences between it and RestfulController .

RestfulController provides basic CRUD capability and a number of methods designed for extension to customize that behavior. See https://github.com/grails/grails-core/blob/v3.3.9/grails-plugin-rest/src/main/groovy/grails/rest/RestfulController.groovy .

And secondly I wanted to know which API implementation (Jersey or RestEasy) is Grails using at it's end.

Grails is not using Jersey or RestEasy. Grails implements its own API.

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