In basic HTML, a link can have the target="_blank"
property to force it to open in a new window or tab. But if when I put that in an <a href>
tag that also includes a th:href
for Thymeleaf, Thymeleaf overwrites the whole tag and wipes out my target="_blank
.
I've considered the brute force method of adding target="_blank"
to every link as it is stored in my database so that it is already part of the link when Thymeleaf writes it out. But I would prefer a way to have Thymeleaf write the target="_blank"
property as it is writing the <a>
tag.
Thymeleaf overwrites the a
tag. Use th:target="_blank"
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With