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
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.
VelocityEngineFactory.setConfigLocation(org.springframework.core.io.Resource)
,
VelocityEngineFactory.setVelocityProperties(java.util.Properties)
,
VelocityEngineFactory.setResourceLoaderPath(java.lang.String)
,
org.springframework.web.servlet.view.velocity.VelocityConfigurer
logger
Constructor and Description |
---|
VelocityEngineFactoryBean() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
org.apache.velocity.app.VelocityEngine |
getObject() |
Class<? extends org.apache.velocity.app.VelocityEngine> |
getObjectType() |
boolean |
isSingleton() |
createVelocityEngine, getResourceLoader, initSpringResourceLoader, initVelocityResourceLoader, isPreferFileSystemAccess, newVelocityEngine, postProcessVelocityEngine, setConfigLocation, setOverrideLogging, setPreferFileSystemAccess, setResourceLoader, setResourceLoaderPath, setVelocityProperties, setVelocityPropertiesMap
public void afterPropertiesSet() throws IOException, org.apache.velocity.exception.VelocityException
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
IOException
org.apache.velocity.exception.VelocityException
public org.apache.velocity.app.VelocityEngine getObject()
getObject
in interface org.springframework.beans.factory.FactoryBean<org.apache.velocity.app.VelocityEngine>
public Class<? extends org.apache.velocity.app.VelocityEngine> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean<org.apache.velocity.app.VelocityEngine>
public boolean isSingleton()
isSingleton
in interface org.springframework.beans.factory.FactoryBean<org.apache.velocity.app.VelocityEngine>