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>
<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>
相关文章推荐
- 整合Struts2+Spring2.5+Hibernate3.5
- Struts2+Spring2.5+Hibernate3.5的整合开发
- spring2.5整合struts1.3注意地方
- 学习笔记ssh2(struts2+hibernate3.2+spring2.5)整合
- Struts2+Spring2.5+Hibernate3.3 整合总结
- Spring MVC+Mybatis+Maven+Velocity+Mysql整合实例
- spring整合velocity和freemaker
- Spring2.5整合Activiti 5.11 解决MalformedParameterizedTypeException问题
- spring2.5和struts1.3.8整合
- spring2.5整合struts2
- struts2+hibernate3.0+spring2.5框架整合
- Sruts2.1+JPA(Hibernate3.0)+Spring2.5整合详解
- Struts-2 + Spring-2.5 + Hibernate-3 整合关键点
- Spring2.5+Struts1.3.8+JPA(Hibernate实现)整合之五
- Spring2.5+Struts1.3.8+Jpa(Hibernate实现)整合之六
- Spring2.5+Struts2+Hibernate3整合之三
- struts1.x+spring2.5+JPA(hibernate)整合
- 整合struts1.2+spring2.5+hibernate3.2实现简单登录
- Spring整合velocity
- Annotation的Struts2.0+Hibernate3.3+Spring2.5整合开发(1)