- List item选择菜单 File -> new -> Spring Starter Project
如果出现这个错误: JSONException: A JSONObject text must begin with ‘{’ at character 0
把Service URL 改为: http://start.spring.io ==>> https://start.spring.io
第二步:
选择包支持
第三步:finish
- 项目文件说明
- 添加网页
在resource -> static 目录下,右键,新建html文件,代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>首页</title>
</head>
<body>
我的第一个Spring Boot页面
</body>
</html>
- 运行项目
选择java -> DemoApplication.java,右键选择 Run As -> Spring Boot App,启动Spring Boot服务
在浏览器地址栏输入: http://localhost:8080/index.html
即可看到首页