标签:markers tco cape -- template nal util ati val
在servlet-context中添加
<bean id="viewResolverJsp" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/pages/"/>
<property name="suffix" value=".jsp"/>
<property name="contentType" value="text/html; charset=UTF-8"/>
<property name="viewClass" value="org.springframework.web.servlet.view.InternalResourceView"/>
<property name="order" value="1"/>
</bean>
<!-- 配置freeMarker视图解析器 -->
<bean id="viewResolverFtl" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
<property name="viewClass" value="com.lianjinsoft.app.common.FreeMarkerViewUtil"/>
<property name="contentType" value="text/html; charset=UTF-8"/>
<property name="exposeRequestAttributes" value="true"/>
<property name="exposeSessionAttributes" value="true"/>
<property name="exposeSpringMacroHelpers" value="true"/>
<property name="cache" value="true"/>
<property name="suffix" value=".ftl"/>
<property name="order" value="0"/>
<property name="requestContextAttribute" value="request"/>
</bean>
<!-- 配置freeMarker的模板路径 -->
<!-- spring-context-support -->
<bean id="freeMarkerConfigurer" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
<property name="templateLoaderPath" value="/WEB-INF/pages/"/>
<property name="freemarkerVariables">
<map>
<entry key="xml_escape" value-ref="fmXmlEscape"/>
</map>
</property>
<property name="freemarkerSettings">
<props>
<prop key="template_update_delay">0</prop>
<prop key="classic_compatible">true</prop>
<prop key="defaultEncoding">utf-8</prop>
</props>
</property>
</bean>
<bean id="fmXmlEscape" class="freemarker.template.utility.XmlEscape"/>
标签:markers tco cape -- template nal util ati val
原文地址:http://blog.51cto.com/12133258/2298768