ResourceBundle rb=ResourceBundle.getBundle("com.a.b");//com/a/b.properties文件,按.分隔路径
rb.getString("ds.name");

解决方案 »

  1.   

    private void init(String fileName) throws UUMSException
      {
        InputStream file = null;
        if (fileName == null)
        {
          file = getClass().getResourceAsStream("/db.properties");
        }
        else
        {
          try
          {
            file = new FileInputStream(fileName);
          }
          catch (FileNotFoundException e)
          {
            logger.info("文件没有找到,可能原因是:" + e.getMessage());
            throw new UUMSException("400001",e);
          }
        }
      }这个是从WEB-INF目录下找配置文件,要改动就按你自己的要求改吧