云飞扬 - 个人博客

Spring.boot 项目创建之傻瓜教程

2018-04-27

新建项目

【File】–>【New】–>【Spring Starter Project】

新建项目

填写项目信息

  • Name 项目名称
  • Location 文件位置
  • Type 选择Maven
  • Group com.shaw.wap
  • Artifact wap
  • version 0.0.1-SNAPSHOT
  • Description 描述
  • Package 包结构
    New Spring Start Project

选择Spring Boot 版本

New Spring Start Project

导入架包

New Spring Start Project

项目结构

project

备注

application.properties 配置信息
ShawSpringWapApplication main 方法

启动服务

创建 HomeController.java

创建HomeController

1
2
3
4
5
6
7
8
9
10
11
12
13
14
package com.shaw.wap;

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

@RestController
public class HomeController {

@RequestMapping(value="/hello",method=RequestMethod.GET)
public String Say(){
return "hello world!";
}
}

运行程序

运行程序

范围查看效果

访问链接:http://localhost:8080/hello

查看结果

Tags: java
使用支付宝打赏
使用微信打赏

若你觉得我的文章对你有帮助,欢迎点击上方按钮对我打赏

扫描二维码,分享此文章