| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
10年前发布

基于Groovy + SpringMVC 的一套Rest JSON API

CoC 理念的一套HTTP JSON API框架,基于SpringMVC 和 Groovy,内置了 MongoDB CRUD模版(JSON和MongoDB天然好基友)!!

Overview

  • Write Your Controller In Groovy
    @Rest  class MyController extends ControllerSupport7 {        def hello(HttpServletRequest req) {          [code: 1, data: "Hello, ${req['name']} !"]      }    }
  • Open http://localhost:8080/my/hello?name=World
{"code":1,"data":"Hello, World !"} 

That's ALL !!!

  • the main Convention

As you see,my is the Controller Name (first lowercase) and hello is the method Name.This is The main Convention.
Don't forget the @Rest annotation on the controller.

@Rest = @Controller (SpringMVC) + @CompileStatic (Groovy)
@RestWithSesson = @Controller + @CompileStatic + @Interceptors

项目主页:http://www.open-open.com/lib/view/home/1409120254260

 本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1409120254260.html
SpringMVC JEE框架