您的位置:首页 > 编程语言 > Java开发

spring2.5同velocity整合

2009-03-05 15:00 495 查看
<!-- 配置Velocity -->

<bean id="velocityConfigurer" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
<property name="resourceLoaderPath">
<value>/WEB-INF/velocity/</value>
</property>
<property name="velocityProperties">
<props>
<prop key="directive.foreach.counter.name">loopCounter</prop>
<prop key="directive.foreach.counter.initial.value">0</prop>
</props>
</property>
<property name="configLocation" value="/WEB-INF/velocity.properties" />
</bean>

<!--
View resolvers can also be configured with ResourceBundles or XML files. If you need
different view resolving based on Locale, you have to use the resource bundle resolver.
-->
<bean id="viewResolver" class="org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.velocity.VelocityLayoutView"/>
<property name="order" value="0"/>
<property name="cache" value="false"/>
<!-- property name="prefix" value="/WEB-INF/velocity/"/> -->
<property name="suffix" value=".vm"/>
<property name="contentType" value="text/html;charset=GBK"/>
<property name="layoutUrl" value="layout/layout.vm"/>
<!-- if you want to use the Spring Velocity macros, set this property to true -->
<property name="exposeSpringMacroHelpers" value="true"/>
<!--if you want to export request to vm.-->
<property name="exposeRequestAttributes" value="true"/>
<!--If you want to export session to vm.-->
<property name="exposeSessionAttributes" value="true"/>
<property name="redirectHttp10Compatible" value="false"/>
<property name="toolboxConfigLocation" value="/WEB-INF/toolbox.xml"/>
<!-- variable to override layoutUrl -->
<property name="layoutKey" value="layout"/>
<property name="screenContentKey" value="screen_content"/>
</bean>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: