spring boot
1.访问http://start.spring.io/
2.根据自己的实际情况构建基础工程。我使用的是maven 和 spring boot 1.5
3.解压项目导入自己的IDE中。我这里使用的是IDEA。
编写Hello word
pom.xml文件引入web模块:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
引入之后创建HelloWordController
类:
类:
@RestController
@RequestMapping("hello")
public class HelloWordController {
@RequestMapping("helloWord")
public String helloWord(){
return "hello Word";
}
}
运行程序:访问http://localhost:8080/hello/helloWord
结果: