SpringBoot入门HelloWorld

Idea new一个项目:

1.

2.

 

 3.

 

4.

 

5.完成基本创建,创建controller层代码

package com.comtroller;

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

@Controller
public class TestController {

    @RequestMapping("/test")
    public @ResponseBody String test(){
        return "Hello SpringBoot";
    }
}

6.运行:http://localhost:8080/test

 

posted @ 2019-10-23 14:12  Cool_Yang  阅读(157)  评论(0编辑  收藏  举报