ITeye博客

jsp 读取配置文件

ts88 · 2013-01-29 19:58 · java · 编程语言 · Markdown


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);
    }

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。