spring boot入门教程--Hello Spring Boot

1、创建项目




然后完成


增加注解,写一个返回Hello Spring Boot的方法

package com.example.girl;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @RequestMapping(value = "/hello",method = RequestMethod.GET)
    public String say(){
        return "Hello Spring Boot!";
    }
}


参考

猜你喜欢

转载自blog.csdn.net/owenfy/article/details/81026300