jquery

gist JS

Monday, April 16, 2007

Freemarker Spring

Sorry, another soporific blog post for those of you not building websites.

So you get:
freemarker.template.TemplateModelException: 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').

And you feel bad about doing things described as "last chance" but where to specify freemarker variable in you spring config?



<bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer" abstract="false"
singleton="true" lazy-init="default" autowire="default" dependency-check="default">
<property name="templateLoaderPath">
<value>/</value>
</property>
<property name="freemarkerSettings">
<props>
<prop key="datetime_format">MM/dd/yyyy</prop>
<prop key="number_format">0.#####</prop>
<prop key="url_escaping_charset">ISO-8859-1</prop>
</props>
</property>
</bean>

5 comments:

Unknown said...

Thanks Jeff. Works great! Saved my day!

Anonymous said...

I don't have files with such tags in my Spring project. Only -

Anonymous said...

...only "<"/beans:bean">""<"/beans:bean">". (Without ".)

Anonymous said...

except data.xml

IT said...

IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. Final Year Project Domains for IT It gives you tips and rules that is progressively critical to consider while choosing any final year project point.

Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining the authors explore the idea of using Java in Big Data platforms.
Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai


The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training