-
Aug 5th, 2012, 08:15 PM
#1
Configure the objectwrapper for FreeMarker
<bean id="beansWrapper" class="freemarker.ext.beans.BeansWrapper">
<property name="exposeFields" value="true" />
</bean>
<bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freema rker.FreeMarkerConfigurer">
<property name="objectWrapper">
<ref local="beansWrapper" />
</property>
<property name="templateLoaderPath">
<value>/WEB-INF/views/</value>
</property>
</bean>
That doesn't work, I get an exception:
org.springframework.beans.NotWritablePropertyExcep tion: Invalid property 'objectWrapper' of bean class [org.springframework.web.servlet.view.freemarker.Fr eeMarkerConfigurer]: Bean property 'objectWrapper' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
setObjectWrapper needs an instance of ObjectWrapper, I thought I was passing one in this configuration.
-
Sep 4th, 2012, 07:07 PM
#2
Sorry to bump this, I forgot I had written it.
I solved the problem though and I hate forum posts that pose a question, and then people go "oh, fixed it, it's cool" and not say anything.
My solution to enable public properties on Freemarker is here: http://psikon.com/2012/08/29/springm...ic-properties/
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules