WEB项目加载配置文件并读取配置文件


           Properties prop = new Properties();  
            // 获取servlet上下文的绝对路径,用上面介绍的二种方法之一
           
           prop.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("huishangppt.properties"));

猜你喜欢

转载自blog.csdn.net/lzp492782442/article/details/41746965