类 VelocityEngineFactoryBean

java.lang.Object
cn.aradin.spring.velocity.ui.VelocityEngineFactory
cn.aradin.spring.velocity.ui.VelocityEngineFactoryBean
所有已实现的接口:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.FactoryBean<org.apache.velocity.app.VelocityEngine>, org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware

public class VelocityEngineFactoryBean extends VelocityEngineFactory implements org.springframework.beans.factory.FactoryBean<org.apache.velocity.app.VelocityEngine>, org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware
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.

The simplest way to use this class is to specify a "resourceLoaderPath"; you do not need any further configuration then. For example, in a web application context:

 <bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
   <property name="resourceLoaderPath" value="/WEB-INF/velocity/"/>
 </bean>
See the base class VelocityEngineFactory for configuration details.
作者:
Juergen Hoeller
另请参阅:
  • 构造器详细资料

    • VelocityEngineFactoryBean

      public VelocityEngineFactoryBean()
  • 方法详细资料

    • afterPropertiesSet

      public void afterPropertiesSet() throws IOException, org.apache.velocity.exception.VelocityException
      指定者:
      afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBean
      抛出:
      IOException
      org.apache.velocity.exception.VelocityException
    • getObject

      public org.apache.velocity.app.VelocityEngine getObject()
      指定者:
      getObject 在接口中 org.springframework.beans.factory.FactoryBean<org.apache.velocity.app.VelocityEngine>
    • getObjectType

      public Class<? extends org.apache.velocity.app.VelocityEngine> getObjectType()
      指定者:
      getObjectType 在接口中 org.springframework.beans.factory.FactoryBean<org.apache.velocity.app.VelocityEngine>
    • isSingleton

      public boolean isSingleton()
      指定者:
      isSingleton 在接口中 org.springframework.beans.factory.FactoryBean<org.apache.velocity.app.VelocityEngine>