Web开发
https://getbootstrap.com/docs/4.0/examples/
这块视屏链接:
提取码:1111
webjars官网- Web Libraries in Jars
比如这里引入jquery依赖
模板引擎 Thymeleaf
链接:https://pan.baidu.com/s/1fnKbZfWrZer7-4oikraBOg
提取码:1111
Spring Boot推荐的 Thymeleaf 语法更简单,功能更强大
Thymeleaf 2的版本功能还不算多 去GitHub下找 都放在这里 https://github.com/thymeleaf/thymeleaf
进来找到releases看发布到哪个版本啦
https://github.com/thymeleaf/thymeleaf/releases
springboot如何切换thymeleaf版本
来到官方文档:
根据上面说的 我们只需要在properties标签中换掉版本 这里注意thymeleaf3需要layout2以上才支持 thymeleaf2跟layout1匹配
验证的话在github同理搜索thymeleaf-layout-dialect 找到已发布版本到2.0.0 https://github.com/ultraq/thymeleaf-layout-dialect/releases?after=2.1.2
Thymeleaf使用&语法
只要我们把HTML页面放在classpath:/templates/, thymeleaf就能自动渲染
Thymeleaf官方文档
1.导入 thymeleaf的名称空间 这个就是你写起来会有提示作用
<html lang="en" xmlns:th="http://www.thymeleaf.org">
接下来看看他们的语法规则
th:任意html属性 来替换原生属性的值
表达式
SpringMVC自动配置
链接:https://pan.baidu.com/s/11E1Pjlx9k4FdI_JA_97S-A
提取码:1111
https://docs.spring.io/spring-boot/docs/2.5.0-SNAPSHOT/reference/htmlsingle/#boot-features-spring-mvc
Spring Boot自动配置好了 SpringMVC 以下是 Spring Boot对 SpringMVC的默认
<!-- spring-boot项目中文乱码解决 <properties>标签插入下面两段代码即可
spring-boot项目日志打印中文乱码是因为jar包的问题,因此需要在pom文件中配置(Maven设置utf8编码格式)-->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>