SpringBoot之SpringBoot的启动方式
2021-03-07 05:30
                         标签:work   返回   org   author   关于   app   默认   mamicode   stc      新建一个HelloService类   注意:需要在和生成的启动类在同一级别目录或者下一级目录中,因为SpringBoot启动时会扫描同级包及其子包,放在别处是扫描不到的,除非额外配置(@ComponentScan)      打开生成的启动类,运行其中的Main方法就可以了       启动时会打印一些信息     因为我写的接口没有写URI所以默认就是项目的根路径         可以看到返回了数据 作者:彼岸舞 时间:2021\01\12 内容关于:SpringBoot 本文来源于网络,只做技术分享,一概不负任何责任 SpringBoot之SpringBoot的启动方式 标签:work   返回   org   author   关于   app   默认   mamicode   stc    原文地址:https://www.cnblogs.com/flower-dance/p/14267932.htmlSpringBoot之SpringBoot的启动方式
 编写测试接口

package com.springboot.demo.service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 *
 * @author ZYGisComputer
 */
@RestController
public class HelloService {
    @GetMapping
    public String getUser(){
        return "彼岸舞";
    }
}
启动方式


 测试访问

上一篇:java基础学习2
下一篇:SpringMVC的请求和响应
文章标题:SpringBoot之SpringBoot的启动方式
文章链接:http://soscw.com/index.php/essay/61205.html