Jfinal启动时,我想使用java代码设置让其加载指定文件路径的undertow.txt文件,只通过java代码办到,这个要怎么弄?
File file = new File("");
try {
String filePath = file.getCanonicalPath();
System.out.println("项目路径:"+filePath);
UndertowServer.create(AppConfig.class, filePath+"\\config\\undertow.txt") ;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
UndertowServer.start(AppConfig.class, 8080, true);以上代码运行,会直接报“com.jfinal.server.undertow.PropExt$FileNotFoundException: Properties file not found in classpath:”异常。方法不对么?能用绝对路径么?
项目:JFinal
create 方法支持指定的配置文件