1、环境约束
- win10 64位操作系统
- idea2018.1.5
- maven-3.0.5
- jdk-8u162-windows-x64
2、前提约束
- idea已安装 https://www.jianshu.com/p/1ad292812ab1
- jdk8已安装 https://www.jianshu.com/p/2d60d5f7ba46
- maven-3.0.5已安装 https://www.jianshu.com/p/31eec3a1b6db
3、创建一个springboot项目
按一下步骤操作:
(1)打开idea
创建项目
(2)按上图操作,进入如下界面:
选中Spring Initializr
(3)选中"Spring Initializr",进入如下界面:
设置groupid,artifactid
(4)填写groupid,artifactid,进入如下界面:
选中Web
(5)选中Web,进入如下界面:
确认项目名称和路径
(6)点击"Finish",等待,则项目创建成功。
4、在src/main/resources/static下创建一个index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
hello world!
</body>
</html>
5、启动web工程
具体操作如下:
启动工程
6、测试
打开浏览器,输入http://localhost:8080/index.html
具体操作如下:
测试
至此,我们完成了springboot创建一个web项目,并做了测试。