In my Thymeleaf
template I need to set a custom attribute to a dynamically generated value. How would I do that?
I tried th:attr="name=value"
, but it seems to be pretty much strict about the 'value' part. For instance, I tried to generate the following attribute:
<div ng-init="myUrl='http://myhost.com/something'> ... </div>
where http://myhost.com/something
is a dynamic part of the ng-init
attrubute and is generated by Thymeleaf's URL expression, like @{...}
Any suggestions how to compose an expression that would produce the above piece of HTML?