Thymeleaf动态加载select下拉框,并选中后台返回的对应类型作为回显
Thyme leaf应该翻译成百里香的叶子(spring boot推荐使用的页面模板,比JSP帅气一些),驼峰命名ThymeLeaf,其中L显得较为突兀,就像ipad或者iphone如果P小写那么显得p腿太长了,不协调,iPad或者iPhone,好了,这是我瞎编的,我这样理解不影响使用,毕竟这个单词查不到,不好读,所以我喜欢拆开方便理解.(标题的重点在最后)
pom依赖
<!--thymeleaf百里香叶页面-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
配置文件配置(yml也可以)
#thymeleaf配置
#模板的模式,支持如:HTML、XML、TEXT、JAVASCRIPT等
spring.thymeleaf.mode=HTML5
#编码,可不用配置
spring.thymeleaf.encoding=UTF-8
#内容类别,可不用配置
spring.thymeleaf.servlet.content-type=text/html
#开发配置为false,避免修改模板还要重启服务器
spring.thymeleaf.cache=false
#配置模板路径,默认就是templates,可不用配置
#spring.thymeleaf.prefix=classpath:/templates/
常用标签(类