dao.js配置:
var ioc = {
conf : {
type : "org.nutz.ioc.impl.PropertiesProxy",
fields : {
paths : ["../"]
}
}
}
发布的目录结构:
D:\JavaKit\apache-tomcat-64-7.0.72\webapps\CMY\WEB-INF\classes\nutz
但是在
/**
* 加载指定文件/文件夹的Properties文件,合并成一个Properties对象
* <p>
* <b style=color:red>如果有重复的key,请务必注意加载的顺序!!<b/>
*
* @param paths
* 需要加载的Properties文件路径
*/
public void setPaths(String... paths) {
clear();
try {
List<NutResource> list = getResources(paths);//这句
返回的结果有:
[File[D:\JavaKit\apache-tomcat-64-7.0.72\webapps\CMY\WEB-INF\classes..\classes\db.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\webapps\CMY\WEB-INF\classes..\classes\freemarker.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\webapps\CMY\WEB-INF\classes..\classes\log4j.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\webapps\CMY\WEB-INF\classes..\classes\nutz\msg\zh-CN\user.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\conf\catalina.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\conf\logging.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\webapps\CMY\WEB-INF\classes\db.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\webapps\CMY\WEB-INF\classes\freemarker.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\webapps\CMY\WEB-INF\classes\log4j.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\webapps\CMY\WEB-INF\classes\nutz\msg\zh-CN\user.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\webapps\examples\WEB-INF\classes\LocalStrings.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\webapps\examples\WEB-INF\classes\LocalStrings_en.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\webapps\examples\WEB-INF\classes\LocalStrings_es.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\webapps\examples\WEB-INF\classes\LocalStrings_fr.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\webapps\examples\WEB-INF\classes\LocalStrings_pt.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\www\Estate\WEB-INF\classes\config.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\www\Estate\WEB-INF\classes\custom\cron.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\www\Estate\WEB-INF\classes\custom\db.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\www\Estate\WEB-INF\classes\custom\mail.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\www\Estate\WEB-INF\classes\freemarker.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\www\Estate\WEB-INF\classes\language\EYOOO_en_US.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\www\Estate\WEB-INF\classes\language\EYOOO_zh_CN.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\www\Estate\WEB-INF\classes\log4j.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\www\Estate\WEB-INF\classes\nutz\msg\zh-CN\user.properties],
File[D:\JavaKit\apache-tomcat-64-7.0.72\bin..\www\Estate\WEB-INF\classes\quartz.properties]]
发现Scan.me().loadResource("^.+[.]properties$", "../");不单扫当前项目下的文件,还会扫描整个tomcat下的文件。
是bug? 还是开发时有意图的呢?