首页 > 解决方案 > How to stop character encoding in thymeleaf from changing url get parameter '?' character to changing to %3F

问题描述

code is like:-

<a th:href="@{{path}(path=${templatebitcointalkforumlink})}"

and from properties file:-

eg:- template variable=https://bitcointalk.org/index.php?topic=4456828

Note:- i don't own this post/topic it's just example

now it changes to:-

https://bitcointalk.org/index.php%3Ftopic=4456827

标签: thymeleaf

解决方案


You shouldn't be using @{...} if you don't want to take advantage auto encoded parameters, url replacement params, etc.. Instead, just use a regular variable.

<a th:href="${templatebitcointalkforumlink}">...</a>

推荐阅读