spring boot 作为Spring的新产品

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u013115157/article/details/77050852
spring boot 作为Spring的新产品,为更好的让人使用,它提供了一个很好用的工具,在浏览器中打开

这里可选择是创建项目的类型:


Group与Artifact填写项目信息,在Search for dependencies中输出web并选择

完成后点击Generate Project alt+Enter 会在浏览器下载一个压缩包,并进行解压,通过Idea导入项目,
在com.example.springbootsamplehelloworld下创建HelloController.java并输入内容如下
package com.example.springbootsamplehelloworld;

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

/**
 * Created by Lzh on 2017/7/14.
 */
@RestController
public class HelloController {
    @RequestMapping("/")
    public String helloworld(){
        return "Hello world!";
    }

    @RequestMapping("/hello/{name}")
    public String hellName(@PathVariable String name){
        return "Hello "+name;
    }
}

下面是小编的微信转帐二维码,小编再次谢谢读者的支持,小编会更努力的

----请看下方↓↓↓↓↓↓↓

百度搜索 Drools从入门到精通:可下载开源全套Drools教程

深度Drools教程不段更新中:


更多Drools实战陆续发布中………

扫描下方二维码关注公众号 ↓↓↓↓↓↓↓↓↓↓



猜你喜欢

转载自blog.csdn.net/u013115157/article/details/77050852
今日推荐