SpringBoot:第一篇 新建spring boot 应用

1.idea 新建spring boot项目 File-> new Project

2.web 应用---选择web应用

3.Controller

package com.example.demo.controller;

/**
 * @author duanxiaoqiu
 * @Date 2019-06-14 15:05
 **/

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

@Controller
@RequestMapping("/")
public class TestController {

    @RequestMapping("/")
    @ResponseBody
    public String index(){
        //log.info("++++");
        return "hello world";
    }

}

4.结果 http://localhost:8080/

posted @ 2019-06-14 14:48  诸葛子房  阅读(208)  评论(0编辑  收藏  举报