我使用的是Groovy&Grails,我想要使用正常的Grails Controller 作为Rest Controller和使用RestFulController类之间的区别;其次,我想知道到底是Grails使用哪个API实现(Jersey或RestEasy)。
最佳答案
I wanted the difference between using nomal Grails controller as Rest Controller the using RestFulController class.
差异取决于您在普通Grails Controller 中放置的内容。如果将与
RestfulController
提供的行为相同的行为置于常规 Controller 中,则当然不会有功能上的差异。如果您在普通 Controller 中没有像RestfulController
那样提供相同的行为,那么您在 Controller 中所放置内容的细节将决定它与RestfulController
之间的区别。RestfulController
提供了基本的CRUD功能以及许多旨在扩展以自定义行为的方法。参见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没有使用Jersey或RestEasy。 Grails实现了自己的API。
关于rest - 如果我在Groovy&Grails中创建一个简单的 Controller 并将其用作Rest API Controller ,然后再扩展RestFulController,该怎么办?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53815978/