Benedictus Benedictus - 4 days ago 6
HTML Question

Thymeleaf get url attribute

I'd like to extract url attributes in thymeleaf template. I'm trying it like this:

Send this query

http://somedomain/myPage?text=blah


myPage.html

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


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

Answer

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

Comments