mirror of
https://gitee.com/coder-xiaomo/java-note
synced 2025-09-06 11:51:38 +08:00
12
This commit is contained in:
@@ -4826,10 +4826,26 @@ src/main/java/org/example/web/UserController.java
|
|||||||
通过 `tx:next=${控制器传递过来的参数}` 显示文本内容
|
通过 `tx:next=${控制器传递过来的参数}` 显示文本内容
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<span th:text="${book.getBookName()}">空</span>
|
|
||||||
<span th:text="${book.bookName}">空</span>
|
<span th:text="${book.bookName}">空</span>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
###### 拼接
|
||||||
|
|
||||||
|
> 字符串
|
||||||
|
|
||||||
|
```html
|
||||||
|
<span th:text="'欢迎你'+${book.bookName}+'!'">空</span>
|
||||||
|
<span th:text="|欢迎你${book.bookName}!|">空</span>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
###### 运算
|
||||||
|
|
||||||
|
> `${}` 内部是通过OGNL表达式 引擎解析的,外部的才是通过Thymeleaf的引擎解析的,因此运算符尽量放在 `${}` 之外
|
||||||
|
|
||||||
#### SpringMVC字符集编码设置
|
#### SpringMVC字符集编码设置
|
||||||
|
|
||||||
##### SpringMVC解决中文乱码问题
|
##### SpringMVC解决中文乱码问题
|
||||||
|
Reference in New Issue
Block a user