Spring Boot来简化Spring应用开发,约定大于配置, 去繁从简。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
package com.lglbc.springbootlearning;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class IndexController {
@RequestMapping("/test")
public String hello(){
return "helloWorld";
}
}
http://localhost:8080/test
成长心路 | 优质书单 | 面试资料
牛人故事 | 前沿技术 | 视频教程