URL's with # not being written correctly
See original GitHub issueHi,
Java 1.8u5 b13. Thymeleaf 2.1.3
I have the following defined in a template:
<a th:href="@{${resetTokenLink}(r=${token})}"><span th:text="${resetTokenLink}">blah</span></a>
I’m passing into my Context, the following:
context.setVariable("resetTokenLink", getDomain() + '/' + resetTokenLink);
context.setVariable("token", token);
getDomain() returns this:
https://www.domain.com
and resetTokenLink variable is defined as:
#/resetToken
Inside the Context (when I observe with a breakpoint), I’m seeing this:
resetTokenLink=https://www.domain.com/#/resetToken
token=kjsk2j3k23
I’m expecting this (URL) to be rendered in the template:
https://www.domain.com/#/resetToken?r=kjsk2j3k23
Instead, I’m getting this:
<a shape="rect" href="https://www.domain.com/?r=kjsk2j3k23#/resetToken"><span>https://www.domain.com/#/resetToken</span></a>
Notice how the “r” comes before the “#” and the URL is malformed.
Perhaps a bug?
-=david=-
Issue Analytics
- State:
- Created 9 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
How to Fix URL Problems- 6 Effective Techniques - Appsero
The URL will not work if the page doesn't exist. Sometimes, a correct URL will not work because the host deleted it or...
Read more >How to Troubleshoot an Error in a URL - Lifewire
While there are a number of reasons this might happen, often times the URL is simply incorrect. If there's a problem with a...
Read more >3 Common URL Problems and How to Fix Them - SEO.com
Problem #1: Non-www and www Versions of Site URLs. If your site has a non-www and www version of all your URLs, you're...
Read more >How to Format URLs in Text - Quick and Dirty Tips ™
Today's topic is how to treat URLs when you have to use them in text. Web addresses are strange beasts; they seem more...
Read more >The Complete Guide on Structuring Your URLs Correctly
The recommended character length is listed at no longer than 2,083 characters max — and this is a generous number. Ideally, you really...
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
Just in case somebody hits this problem: just build your url and pass it to the template:
<a th:href="${resetUrl}">link</a>
This should work fine.
Hi,
Thank you Daniel for the consideration of this issue. I understand where you are coming from and it seems the best approach 😃
Thanks again for a great framework and tools! 😃
-=david=-
On 6 August 2014 20:30, Daniel Fernández notifications@github.com wrote:
I prefer encrypted and signed messages. KeyID: B20A22F9 Fingerprint: 110A F423 3647 54E2 880F ADAD 1C52 85BF B20A 22F9
“It is not usually until you’ve built and used a version of the program that you understand the issues well enough to get the design right.” - Rob Pike, Brian Kernighan.
No trees were harmed in the sending of this message, however, a number of electrons were inconvenienced.