beetl属性文件支持自动发现,以beetl-前缀即可。

This commit is contained in:
thinkgem
2018-01-07 22:28:02 +08:00
parent a59c978603
commit c629a2005a
4 changed files with 257 additions and 242 deletions

View File

@@ -9,6 +9,7 @@ import java.io.InputStream;
import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader; import org.springframework.core.io.ResourceLoader;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import com.jeesite.common.lang.ExceptionUtils; import com.jeesite.common.lang.ExceptionUtils;
@@ -21,6 +22,14 @@ public class ResourceUtils extends org.springframework.util.ResourceUtils {
private static ResourceLoader resourceLoader = new DefaultResourceLoader(); private static ResourceLoader resourceLoader = new DefaultResourceLoader();
/**
* 获取资源加载器可读取jar内的文件
* @author ThinkGem
*/
public static ResourceLoader getResourceLoader() {
return resourceLoader;
}
/** /**
* 获取ClassLoader * 获取ClassLoader
*/ */
@@ -64,11 +73,17 @@ public class ResourceUtils extends org.springframework.util.ResourceUtils {
} }
/** /**
* 获取资源加载器可读取jar内的文件 * Spring 搜索资源文件
* @param locationPattern
* @author ThinkGem * @author ThinkGem
*/ */
public static ResourceLoader getResourceLoader() { public static Resource[] getResources(String locationPattern){
return resourceLoader; try {
return new PathMatchingResourcePatternResolver()
.getResources(locationPattern);
} catch (IOException e) {
throw ExceptionUtils.unchecked(e);
}
} }
} }

View File

@@ -21,7 +21,7 @@ MVC_STRICT = FALSE
IMPORT_PACKAGE= IMPORT_PACKAGE=
##导入JeeSite调用静态方法类自动合并IMPORT_PACKAGE设置 ##导入JeeSite调用静态方法类自动合并IMPORT_PACKAGE设置
IMPORT_PACKAGE_JeeSite=\ IMPORT_PACKAGE_core=\
com.jeesite.common.config.;\ com.jeesite.common.config.;\
com.jeesite.common.codec.;\ com.jeesite.common.codec.;\
com.jeesite.common.collect.;\ com.jeesite.common.collect.;\

View File

@@ -2,7 +2,7 @@
#设置与beetl-default.properties相同的属性将被覆盖默认设置 #设置与beetl-default.properties相同的属性将被覆盖默认设置
##导入项目中的调用静态方法类项目中设置自动合并IMPORT_PACKAGE设置 ##导入项目中的调用静态方法类项目中设置自动合并IMPORT_PACKAGE设置
#IMPORT_PACKAGE_PROJECT=\ #IMPORT_PACKAGE_你的模块编码=\
# com.jeesite.modules.project.utils.;\ # com.jeesite.modules.project.utils.;\
## 内置的方法 ## 内置的方法