LMLPHP后院

thymeleaf 模板对未闭合标签解析出错

thymeleaf 模板对 HTML 文件标签内容太严格的解决方式。1. 在 application.properties 文件中添加如下配置: spring.thymeleaf.mode=LEGACYHTML52. 对于 maven 用户,在 pom.xml 的 dependencies 中添加如下依赖:<dependency> <groupId>net.sourceforge.nekohtml</groupId...

spring boot jpa 多个数据源配置

spring boot jpa 多数据源的配置,对于新手来讲还是不简单的,网上的很多资料都已经过时并且不靠谱。application.properties 配置参考:spring.thymeleaf.prefix=classpath:/templates/ spring.thymeleaf.suffix=.html spring.thymeleaf.mode=LEGACYHTML5 spring.thymeleaf...

FreeMarker 处理不存在的值

FreeMarker 是 Java 的模板引擎,相比起比较偏执的 Thymeleaf 更加人性化一些,本文讲解使用 FreeMarker 处理不存在的值的一些事项。默认值操作符使用形式:unsafe_expr!default_expr 或 unsafe_expr! 或 (unsafe_expr)!default_expr 或 (unsafe_expr)!。如果默认值被省略了,那么结果将会是空串,空序列或空哈希表。 ...
2024-04-26 14:46:53 1714114013 0.003452