比较这两个方式 在web程序跑和junit时候 显示的内容 是不一样的


C:\danny\code_base\20171031_mpos_bill\MPayBill\src\main\java\citic\hz\mpos\kit\Config.java



引用
String realPath = this.getClass().getClassLoader().getResource("").getPath();
String realPath = "";
try {
realPath = new ClassPathResource("mpos/mposBat.conf").getFile().getAbsolutePath();
System.out.println(new ClassPathResource("mpos/mposBat.conf").getFile().getAbsolutePath());

} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

猜你喜欢

转载自dannyhz.iteye.com/blog/2401538