类 SpringResourceLoader
- java.lang.Object
- org.apache.velocity.runtime.resource.loader.ResourceLoader
- org.springframework.ui.velocity.SpringResourceLoader
public class SpringResourceLoader extends org.apache.velocity.runtime.resource.loader.ResourceLoader
Velocity ResourceLoader adapter that loads via a Spring ResourceLoader. Used by VelocityEngineFactory for any resource loader path that cannot be resolved to ajava.io.File
.Note that this loader does not allow for modification detection: Use Velocity's default FileResourceLoader for
java.io.File
resources.Expects "spring.resource.loader" and "spring.resource.loader.path" application attributes in the Velocity runtime: the former of type
org.springframework.core.io.ResourceLoader
, the latter a String.- 从以下版本开始:
- 14.03.2004
- 作者:
- Juergen Hoeller
- 另请参阅:
VelocityEngineFactory.setResourceLoaderPath(java.lang.String)
,ResourceLoader
,FileResourceLoader
字段概要
字段 修饰符和类型 字段 说明 protected Log
logger
static String
NAME
static String
SPRING_RESOURCE_LOADER
static String
SPRING_RESOURCE_LOADER_CACHE
static String
SPRING_RESOURCE_LOADER_CLASS
static String
SPRING_RESOURCE_LOADER_PATH
构造器概要
构造器 构造器 说明 SpringResourceLoader()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 long
getLastModified(org.apache.velocity.runtime.resource.Resource resource)
InputStream
getResourceStream(String source)
void
init(org.apache.commons.collections.ExtendedProperties configuration)
boolean
isSourceModified(org.apache.velocity.runtime.resource.Resource resource)
字段详细资料
SPRING_RESOURCE_LOADER_CLASS
public static final String SPRING_RESOURCE_LOADER_CLASS
- 另请参阅:
- 常量字段值
SPRING_RESOURCE_LOADER_CACHE
public static final String SPRING_RESOURCE_LOADER_CACHE
- 另请参阅:
- 常量字段值
SPRING_RESOURCE_LOADER
public static final String SPRING_RESOURCE_LOADER
- 另请参阅:
- 常量字段值
SPRING_RESOURCE_LOADER_PATH
public static final String SPRING_RESOURCE_LOADER_PATH
- 另请参阅:
- 常量字段值
构造器详细资料
SpringResourceLoader
public SpringResourceLoader()
方法详细资料
init
public void init(org.apache.commons.collections.ExtendedProperties configuration)
- 指定者:
init
在类中org.apache.velocity.runtime.resource.loader.ResourceLoader
getResourceStream
public InputStream getResourceStream(String source) throws org.apache.velocity.exception.ResourceNotFoundException
- 指定者:
getResourceStream
在类中org.apache.velocity.runtime.resource.loader.ResourceLoader
- 抛出:
org.apache.velocity.exception.ResourceNotFoundException
isSourceModified
public boolean isSourceModified(org.apache.velocity.runtime.resource.Resource resource)
- 指定者:
isSourceModified
在类中org.apache.velocity.runtime.resource.loader.ResourceLoader
getLastModified
public long getLastModified(org.apache.velocity.runtime.resource.Resource resource)
- 指定者:
getLastModified
在类中org.apache.velocity.runtime.resource.loader.ResourceLoader