freemarker配置信息

时间:2022-08-28 17:35:11

<!--  <!– freemarker的配置 –>

<bean id="freemarkerConfigurer"

class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">

<property name="templateLoaderPath" value="/WEB-INF/view/" />

<property name="defaultEncoding" value="GBK" />

<property name="freemarkerSettings">

<props>

<prop key="classic_compatible">true</prop>

<prop key="template_update_delay">10</prop>

<prop key="locale">zh_CN</prop>

<prop key="datetime_format">yyyy-MM-dd HH:mm:ss</prop>

<prop key="date_format">yyyy-MM-dd</prop>

<prop key="number_format">#.##</prop>

</props>

</property>

</bean>

<!– FreeMarker视图解析 如返回userinfo。。在这里配置后缀名ftl和视图解析器。。 –>

<bean id="viewResolver"

class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">

<property name="viewClass"

value="org.springframework.web.servlet.view.freemarker.FreeMarkerView" />

<property name="suffix" value=".ftl" />

<property name="contentType" value="text/html;charset=GBK" />

<property name="exposeRequestAttributes" value="true" />

<property name="exposeSessionAttributes" value="true" />

<property name="exposeSpringMacroHelpers" value="true" />

</bean>

-->