首页 > 编程语言 > 详细

Spring Boot

时间:2017-06-25 22:55:55      阅读:229      评论:0      收藏:0      [点我收藏+]

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMethod;

@RestController //等同于同时加上了@Controller和@ResponseBody
public class HelloControler {

//访问/hello或者/hi任何一个地址,都会返回一样的结果
@RequestMapping(value = {"/hello","/hi"},method = RequestMethod.GET)
public String say(){
return "hi you!!!";
}
}

Spring Boot

原文:http://www.cnblogs.com/mhc-fly/p/7078330.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!