首页 > 编程语言 > 详细

Springboot基础知识

时间:2018-12-05 00:46:52      阅读:129      评论:0      收藏:0      [点我收藏+]

1、@RestController注解

  • Spring4之后新加入的注解,@RestController是@ResponseBody和@Controller的组合注解。(返回json需要@ResponseBody和@Controller配合)
  • pom.xml依赖
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>
  • 在POM中加入spring-boot-starter-web依赖, @RestController还是不能用的解决方法:手动导入包。
import org.springframework.web.bind.annotation.RestController; 

 

Springboot基础知识

原文:https://www.cnblogs.com/gavincoder/p/10068433.html

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