Thymeleaf seems to be escaping the & character while rendering the th::href attribute and also adding a shape attribute (?)
See original GitHub issueI don’t know if I am doing something wrong, but there seems to be a bug while rendering the th::href attribute using the @{…} syntax.
<a th:href="@{/foo/bar(bug='y',ornot='f')}" href="#"></a>
The result I am getting is:
<a href="/foo/bar?bug=y&ornot=f" shape="rect"></a>
It’s escaping the ‘&’ character and adding a shape attribute.
Please! I really need a fix… I am using it everywhere. =(
Issue Analytics
- State:
- Created 10 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Tutorial: Using Thymeleaf
If we want Thymeleaf to respect our XHTML tags and not escape them, we will have to use a different attribute: th:utext (for...
Read more >Escaping '&' character in thymeleaf - Stack Overflow
The way that you escape an ampersand & in any html attribute is & . Actually you should always escape ampersands in all...
Read more >Using-Thymeleaf_百度文库
The main goal of Thymeleaf is to provide an elegant and well-formed way of creating templates. In order to achieve this, it is...
Read more >Spring in Action
is called when the knight's embarkOnQuest() method is called. ... as the first character of an attribute, I had to add an underscore...
Read more >Spring in Action, 4th Edition: Covers Spring 4 (2015)
Chapter 6. Rendering web views. This chapter covers. · Rendering model data as HTML. · Using JSP views. · Defining view layout with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Escaping ampersand inside an attribute is correct HTML.
Thymeleaf has its own syntax for URL parameters, look at http://www.thymeleaf.org/doc/html/Using-Thymeleaf.html#link-urls