Announcement Announcement Module
No announcement yet.
Configure the objectwrapper for FreeMarker Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Configure the objectwrapper for FreeMarker

    <bean id="beansWrapper" class="freemarker.ext.beans.BeansWrapper">
    <property name="exposeFields" value="true" />

    <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freema rker.FreeMarkerConfigurer">
    <property name="objectWrapper">
    <ref local="beansWrapper" />
    <property name="templateLoaderPath">

    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.

  • #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: