I am using FreeMarker with Spring to generate my HTML pages. In my Freemarker page I try to URL escape a String
value, like this:
<a href="<@spring.url "/ext/Thing/${thing?url}/"/>">Thing ${thing}</a>
This results in an exception from FreeMarker that complains
ERROR 2014-02-03 11:08:45,513 Error executing FreeMarker template FreeMarker template error: To do URL encoding, the framework that encloses FreeMarker must specify the output encoding or the URL encoding charset, so ask the programmers to fix it. Or, as a last chance, you can set the url_encoding_charset setting in the template, e.g. <#setting url_escaping_charset='ISO-8859-1'>, or give the charset explicitly to the buit-in, e.g. foo?url('ISO-8859-1').
What to do to fix this problem?