请注意,freemarker并不支持模板继承,网上给的其实是扩展出来的功能
为了用这个功能,我们必须引入两个包
commons-lang-2.4.jar(从strus2的lib拿的)
rapid-framework-3.9.3.20100923.jar(这个靠百度搜吧)
扩展配置:
~~~
<bean id="viewResolver"
class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
<property name="order" value="1" />
<property name="cache" value="true" />
<property name="prefix" value="" />
<property name="suffix" value=".html" />
<property name="contentType" value="text/html;charset=UTF-8" />
</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" />
~~~