文章目录
-
- 一、搭建SpringBoot开发环境
-
-
-
- 1. 安装好开发软件和Maven等
- 2. 进入https://start.spring.io/ 站,填写相关信息,导出一个新项目
- 3. 将这个Maven项目导入MyEclipse中
- 4. pom.xml文件配置说明
- 5. 编写测试Controller
- 6. 启动spring boot启动类
- 7. 在浏览器中输入http://localhost:8080/hello查看
- 8. 再刷新http://localhost:8080/hello查看
-
-
- 二、使用Thymeleaf页面模板
-
-
-
- 1. 导入thymeleaf依赖
- 2. 在UserController中编写测试thymeleaf的方法(testThymeleaf)
- 3. 在resources/templates文件夹下新建testThymeleaf.html文件
- 4. 重启项目,访问http://localhost:8080/testThymeleaf
-
-
一、搭建SpringBoot开发环境
1. 安装好开发软件和Maven等
2. 进入https://start.spring.io/ 站,填写相关信息,导出一个新项目
错误原因:程序只加载Application.java所在包及其子包下的内容(https://www.cnblogs.com/JealousGirl/p/whitelabel.html)。
而我的项目启动类所在的包是com.fukaiit.springshiro,将其修改为com.fukaiit。
8. 再刷新http://localhost:8080/hello查看
Tips:
- 在thymeleaf 3.0之前,每个标签必须正确的闭合,否则会提示Whitelabel Error Page错误
- 修改thymeleaf版本的方法:
在pom.xml中配置如下信息:
文章知识点与官方知识档案匹配,可进一步学习相关知识云原生入门技能树k8s包管理(helm)安装helm8936 人正在系统学习中
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!