1
0
mirror of https://gitee.com/coder-xiaomo/java-note synced 2025-09-06 03:51:37 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-01-26 00:52:20 +08:00
parent c0f6d75cbf
commit 11f3ce63b5

View File

@@ -4826,10 +4826,26 @@ src/main/java/org/example/web/UserController.java
通过 `tx:next=${控制器传递过来的参数}` 显示文本内容
```html
<span th:text="${book.getBookName()}">空</span>
<span th:text="${book.bookName}">空</span>
```
###### 拼接
> 字符串
```html
<span th:text="'欢迎你'+${book.bookName}+''">空</span>
<span th:text="|欢迎你${book.bookName}|">空</span>
```
###### 运算
> `${}` 内部是通过OGNL表达式 引擎解析的外部的才是通过Thymeleaf的引擎解析的因此运算符尽量放在 `${}` 之外
#### SpringMVC字符集编码设置
##### SpringMVC解决中文乱码问题