views:

213

answers:

1

So I have Index action in my HomeController.java class.

I have my freemarker templates in:

/web-inf/ftl/test.ftl

How can I load the template?

I have this in my appname-servlet.xml:

 <bean id="viewResolver"
          class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
        <property name="suffix">
            <value>.ftl</value>
        </property>
    </bean>

    <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
        <property name="templateLoaderPath" value="/WEB-INF/freemarker/"/>
    </bean>

What should my action code look like for HomeController index action?

I have /web-inf/freemarker/index.ftl

A: 

Perhaps by reading the documentation ?

Olivier Croisier