zno2

Spring 获取资源文件路径

 

import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

 

some.properties 位于classes 下 

Resource res = new ClassPathResource("some.properties"); 
System.out.println("res:"+res.getURI()); 

 

posted on 2016-08-06 08:09  zno2  阅读(549)  评论(0编辑  收藏  举报

导航