jsp 读取配置文件

private String getData(String key) {
        InputStream inputStream = this.getClass().getClassLoader()
                .getResourceAsStream("conf/upload-image.properties");
        Properties p = new Properties();
        try {
            p.load(inputStream);
        } catch (IOException e1) {
            e1.printStackTrace();
        }
        return p.getProperty(key);
    }

你可能感兴趣的:(java)