Thymeleaf gets url attribute

I would like to extract url attributes in the thimeleaf template. I try it like this:

Send this request http://somedomain/myPage?text=blah

mypage.html

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

Bu instead of blah I get[Ljava.lang.String;@797291bb

+4
source share
1 answer

${param.text}resolves an array. To get the actual value you should use${param.text[0]}

+4
source

Source: https://habr.com/ru/post/1662144/


All Articles