准备材料
- 安装并配置好的idea
创建springboot详细过程如下






到此,springboot项目引入完毕
项目文件目录如下

为项目创建controller

手写第一个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";
}
}
访问项目

访问效果

网友评论