springboot搭建
1、idea新建maven项目
2、pom.xml引入下面代码
org.springframework.boot spring-boot-starter-parent 2.0.3.RELEASE org.springframework.boot spring-boot-starter-web
3、新建application.java
@SpringBootApplicationpublic class WebApplication { public static void main(String[] args) { SpringApplication.run(WebApplication.class, args); }}
4、新建controller
@Controllerpublic class IndexController { @RequestMapping("/index") @ResponseBody public String index() { return "Hello World!"; }}
5、启动main方法,浏览器打开/index,出现helloword