赞
踩
1.利用ClassLoader
InputStream resourceAsStream = Test.class.getClassLoader().getResourceAsStream("spring-context.xml");
2.Resource类型的对象
Resource resource=new ClassPathResource("spring-context.xml");
InputStream inputStream = resource.getInputStream();
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。