Spring Boot实战与原理分析之快速入门

建议spring-boot在项目中开始使用的方法是使用依赖管理系统 - 下面的代码片段可以复制并粘贴到您的构建中。


    org.springframework.boot
    spring-boot-starter-parent
    1.5.9.RELEASE


    
        org.springframework.boot
        spring-boot-starter-web
    
hello/SampleController.java

package hello;

import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.stereotype.*;
import org.springframework.web.bind.annotation.*;

@Controller
@EnableAutoConfiguration
public class SampleController {

    @RequestMapping("/")
    @ResponseBody
    String home() {
        return "Spring Boot视频教程大全/java视频教程大全www.it448.com";
    }

    public static void main(String[] args) throws Exception {
        SpringApplication.run(SampleController.class, args);
    }
}
启动main方法!一个 Spring Boot入门示例就这么简单。

你可能感兴趣的:(JavaEE,Spring,Boot,Spring)