准备材料
- 安装并配置好的idea
创建springboot详细过程如下
image.png image.png image.png image.png image.png image.png到此,springboot项目引入完毕
项目文件目录如下
image.png为项目创建controller
image.png手写第一个helloworld
package com.springboot.demo.springbootdemo.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class HelloWorldController {
@RequestMapping("/hello")
@ResponseBody
public String hello(){
return "Hello spring boot";
}
}
网友评论