zoukankan      html  css  js  c++  java
  • velocity

    配置

    Factory bean that configures a VelocityEngine and provides it as bean reference. This bean is intended for any kind of usage of Velocity in application code, e.g. for generating email content. For web views, VelocityConfigurer is used to set up a VelocityEngine for views.

     <bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
       <property name="resourceLoaderPath"><value>file:/WEB-INF/velocity/</value>lt;/property>
     </bean>

    JavaBean to configure Velocity for web usage, via the "configLocation" and/or "velocityProperties" and/or "resourceLoaderPath" bean properties. The simplest way to use this class is to specify just a "resourceLoaderPath"; you do not need any further configuration then.

     <bean id="velocityConfig" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
       <property name="resourceLoaderPath"><value>/WEB-INF/velocity/</value></property>
     </bean>

    Note that you can also refer to a pre-configured VelocityEngine instance via the "velocityEngine" property, e.g. set up by VelocityEngineFactoryBean, This allows to share a VelocityEngine for web and email usage, for example.

    <bean id="velocityViewResolver" class="org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver"‌​> 
    <property name="cache" value="true"/> 
    <property name="prefix" value=""/> 
    <property name="suffix" value=".vm"/>
     <property name="layoutUrl" value="layout/default.vm" /> 
    <property name="exposeSpringMacroHelpers" value="true"/> 
    <property name="contentType" value="text/xml; charset=utf-8" /> <property name="toolboxConfigLocation" value="classpath:/toolbox.xml"/> <property name="viewClass" value="com.comcast.ivr.agent.web.velocity.VelocityToolsView"/> 
    </bean>
  • 相关阅读:
    通过Java获取图片的信息
    防止浏览器缓冲
    InitializingBean,DisposableBean
    php 直接跳出嵌套循环
    个推IGt.BaseTemplate.php,不仅有bug,还有bom头,好恶心!
    【洛谷】2473:[SCOI2008]奖励关【期望DP(倒推)】
    【BZOJ】4720: [Noip2016]换教室
    【BZOJ】4767: 两双手【组合数学】【容斥】【DP】
    【BZOJ】4318: OSU!【期望DP】
    【BZOJ】4985: 评分【DP】
  • 原文地址:https://www.cnblogs.com/zengyou/p/2846208.html
Copyright © 2011-2022 走看看