1 WEB-INF路径
 2 String path = WsTestBOImpl.class.getClass().getResource("/").getPath();
 3 path = path.substring(1, path.indexOf("classes"));
 4 
 5 web-inf 下面的classses路径(也就是src路径)
 6 String path = WsTestBOImpl.class.getClass().getResource("/").getPath();
 7 path = path.substring(1, path.length());
 8 
 9 --获取.properties配置文件的值--
10 Properties p = new Properties();
11 p.load(new FileInputStream(path + "aaa.properties"));
12 String s = p.getProperty("name");

 http://blog.csdn.net/fancylovejava/article/details/7577294

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2021-12-09
  • 2021-11-27
猜你喜欢
  • 2022-12-23
  • 2021-12-09
  • 2021-12-19
  • 2022-12-23
  • 2022-02-07
  • 2021-12-09
  • 2021-08-29
相关资源
相似解决方案