spring 整合freemarker 实现模板继承

用的是rapid框架中实现的freemarker 继承功能,
spring freamarker配置部分:
	<!--freemarker 配置-->
	<bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
		<property name="templateLoaderPath" value="/WEB-INF/ftl" />
		<property name="freemarkerSettings">
			<props>
				<prop key="template_update_delay">0</prop>
				<prop key="default_encoding">UTF-8</prop>
				<prop key="locale">zh_CN</prop>
			</props>
		</property>
		<property name="freemarkerVariables">
			<map>
				<entry key="block" value-ref="block" />
				<entry key="override" value-ref="override" />
				<entry key="extends" value-ref="extends" />
			</map>
		</property>
	</bean>
	<!--freemarker 模板继承配置-->
	<bean id="block" class="cn.org.rapid_framework.freemarker.directive.BlockDirective" />
	<bean id="override" class="cn.org.rapid_framework.freemarker.directive.OverrideDirective" />
	<bean id="extends" class="cn.org.rapid_framework.freemarker.directive.ExtendsDirective" />

你可能感兴趣的:(spring,框架,xml,freemarker)