标签: java html spring url thymeleaf
我想在百里香叶模板中提取url属性。我正在尝试这样:
发送此查询 http://somedomain/myPage?text=blah
http://somedomain/myPage?text=blah
myPage.html下
<div th:text="${param.text}"></div>
Bu而不是 blah 我得到[Ljava.lang.String;@797291bb
[Ljava.lang.String;@797291bb
答案 0 :(得分:4)
${param.text}解析为数组。要获得实际值,您必须使用${param.text[0]}
${param.text}
${param.text[0]}