thymeleaf标签html5中无效,thymeleaf各种问题,标签没用?网页404?

thymeleaf各种问题,标签没用?网页404?

首先html的网页

//注意这个xmlns后面一定是https,我的就是没加s导致无法识别msg这种变量

Thymeleaf 语法

其次,html文件基本都说是放在templates文件夹下,然后用application.properties写一下解析器(前4行应该都必要写上去)

spring.resources.static-locations=classpath:/templates/

spring.thymeleaf.cache=false

spring.thymeleaf.mode=LEGACYHTML5

spring.thymeleaf.suffix=.html

spring.thymeleaf.encoding=UTF-8

最重要的导入的包!!!!我可能这一天就死在导包上了

1.8

2.1.1

UTF-8

UTF-8

//下面是我觉得必须要用到的包,反正我少一个就起不来,百度上的也没总结,我就自己写了

org.thymeleaf

thymeleaf-spring5

3.0.11.RELEASE

org.springframework.boot

spring-boot-starter-thymeleaf

net.sourceforge.nekohtml

nekohtml

org.springframework.boot

spring-boot-devtools

runtime

true

org.thymeleaf

thymeleaf

3.0.9.RELEASE

当然web的包是必要的这边也再做下累述吧。嫌自己看包麻烦想复制粘贴配置的请复制下面的

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0

org.springframework.boot

spring-boot-starter-parent

2.1.7.RELEASE

1.8

2.1.1

UTF-8

UTF-8

com.joel.shiro

01-demo-shiro

1.0.0

01-demo-shiro

Project for Spring Boot

org.thymeleaf

thymeleaf-spring5

3.0.11.RELEASE

org.springframework.boot

spring-boot-starter-web

org.springframework.boot

spring-boot-starter-thymeleaf

net.sourceforge.nekohtml

nekohtml

org.springframework.boot

spring-boot-starter-test

test

org.springframework.boot

spring-boot-devtools

runtime

true

javax.servlet

javax.servlet-api

javax.servlet.jsp

javax.servlet.jsp-api

2.3.1

org.apache.tomcat.embed

tomcat-embed-jasper

javax.servlet

jstl

org.thymeleaf

thymeleaf

3.0.9.RELEASE

org.apache.shiro

shiro-spring

1.4.0

org.springframework.boot

spring-boot-maven-plugin

src/main/java

**/*.xml

src/main/resources

**/*.*

src/main/webapp

META-INF/resources

**/*.*

最后的话,controller层基本应该没什么问题的,后台传个值到前台。这里也不多做累述。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值