beetl属性文件支持自动发现,以beetl-前缀即可。
This commit is contained in:
@@ -9,6 +9,7 @@ import java.io.InputStream;
|
||||
import org.springframework.core.io.DefaultResourceLoader;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
|
||||
import com.jeesite.common.lang.ExceptionUtils;
|
||||
|
||||
@@ -21,6 +22,14 @@ public class ResourceUtils extends org.springframework.util.ResourceUtils {
|
||||
|
||||
private static ResourceLoader resourceLoader = new DefaultResourceLoader();
|
||||
|
||||
/**
|
||||
* 获取资源加载器(可读取jar内的文件)
|
||||
* @author ThinkGem
|
||||
*/
|
||||
public static ResourceLoader getResourceLoader() {
|
||||
return resourceLoader;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取ClassLoader
|
||||
*/
|
||||
@@ -64,11 +73,17 @@ public class ResourceUtils extends org.springframework.util.ResourceUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取资源加载器(可读取jar内的文件)
|
||||
* Spring 搜索资源文件
|
||||
* @param locationPattern
|
||||
* @author ThinkGem
|
||||
*/
|
||||
public static ResourceLoader getResourceLoader() {
|
||||
return resourceLoader;
|
||||
public static Resource[] getResources(String locationPattern){
|
||||
try {
|
||||
return new PathMatchingResourcePatternResolver()
|
||||
.getResources(locationPattern);
|
||||
} catch (IOException e) {
|
||||
throw ExceptionUtils.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ MVC_STRICT = FALSE
|
||||
IMPORT_PACKAGE=
|
||||
|
||||
##导入JeeSite调用静态方法类(自动合并IMPORT_PACKAGE设置)
|
||||
IMPORT_PACKAGE_JeeSite=\
|
||||
IMPORT_PACKAGE_core=\
|
||||
com.jeesite.common.config.;\
|
||||
com.jeesite.common.codec.;\
|
||||
com.jeesite.common.collect.;\
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#设置与beetl-default.properties相同的属性将被覆盖默认设置
|
||||
|
||||
##导入项目中的调用静态方法类(项目中设置,自动合并IMPORT_PACKAGE设置)
|
||||
#IMPORT_PACKAGE_PROJECT=\
|
||||
#IMPORT_PACKAGE_你的模块编码=\
|
||||
# com.jeesite.modules.project.utils.;\
|
||||
|
||||
## 内置的方法
|
||||
|
||||
Reference in New Issue
Block a user