applicationContext.xml
<bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
<property name="templateLoaderPaths" value="classpath:/views/user/" /><property name="preferFileSystemAccess" value="false" />
<property name="freemarkerSettings">
<props>
<prop key="defaultEncoding">UTF-8</prop>
<prop key="auto_import">/spring.ftl as spring</prop>
</props>
</property>
</bean>
<bean id="viewResolver" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
<property name="prefix" value="/" />
<property name="suffix" value=".ftl" />
<property name="exposeSpringMacroHelpers" value="true" />
<property name="contentType" value="text/html;charset=utf-8"></property>
</bean>