解决方案 »

  1.   

    直接使用 Thread.currentThread().getContextClassLoader().getResource("/").getPath();   获取到classpath的路径
    然后 使用 classpath + "users.properties" 就是你的配置文件的路径了 
    参考 java代码中获取classpath路径 
      

  2.   

    用第一种方法,你得path.getFile()一下
      

  3.   

    String path=UserDaoImpl.class.getResource("/users.properties").getPath(); 
    URLDecoder.decode(path, "UTF-8");
      

  4.   

    在另一个帖子解决了,还是是路径编码与我设置的jsp默认编码不同导致的,给你们分额