Thymeleaf获取url属性

时间:2016-11-28 13:45:10

标签: java html spring url thymeleaf

我想在百里香叶模板中提取url属性。我正在尝试这样:

发送此查询 http://somedomain/myPage?text=blah

myPage.html下

<div th:text="${param.text}"></div>

Bu而不是 blah 我得到[Ljava.lang.String;@797291bb

1 个答案:

答案 0 :(得分:4)

${param.text}解析为数组。要获得实际值,您必须使用${param.text[0]}