欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

使用idea快速创建一个springboot的小demo(自动添加依赖)

程序员文章站 2022-07-07 13:58:34
...

1.file->project->Spring Lnitializr ->

使用idea快速创建一个springboot的小demo(自动添加依赖)
使用idea快速创建一个springboot的小demo(自动添加依赖)
使用idea快速创建一个springboot的小demo(自动添加依赖)
使用idea快速创建一个springboot的小demo(自动添加依赖)
使用idea快速创建一个springboot的小demo(自动添加依赖)

写一个controller

使用idea快速创建一个springboot的小demo(自动添加依赖)
使用idea快速创建一个springboot的小demo(自动添加依赖)

package com.yuanting.springbootquick.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class QuickController {

    @ResponseBody
    @RequestMapping("quick")
    public String quickSpringboot(){

        return "quick Spirngboot";
    }

}

运行项目

使用idea快速创建一个springboot的小demo(自动添加依赖)

测试:http://localhost:8080/quick

使用idea快速创建一个springboot的小demo(自动添加依赖)