idea新建spring boot项目步骤

来源:互联网 发布:小米平板2windows版 编辑:程序博客网 时间:2024/06/05 19:33

1、file
2、new->Project
3、spring Initializr
(这里可以选maven项目,这样就没有springboot的方便性了,springboot中也有选择可以用maven来管理),用springboot项目的好处是src目录下自动生成了java的文件夹,不用手动建立。
4、这里可以选择maven project和maven pom(暂时没弄懂有什么区别)
5、选择spring boot的一些starter pom包:这里可以选择web 和 Thymeleaf 模板引擎
以上是新建操作结束了
6、在springboot的入口类(其实就是默认启动项的类)Demo5Application编写代码
这里写图片描述

7、在templates路径下新建index.html文件;注意在index.html文件中meta > 要加才能运行

注意:项目不能运行,springboot项目看浏览页的报错似乎没什么用,要看后端控制台的才有用

原创粉丝点击