通过servletcontext读取WEB-INF下的配置文件
2015-02-15 13:59
302 查看
InputStream is = request.getSession().getServletContext()
.getResourceAsStream("/WEB-INF/a.properties");
Properties properties = new Properties();
properties.load(is);
System.out.println(properties.getProperty("username"));
is.close();
.getResourceAsStream("/WEB-INF/a.properties");
Properties properties = new Properties();
properties.load(is);
System.out.println(properties.getProperty("username"));
is.close();
相关文章推荐
- 通过servletcontext读取WEB-INF下的配置文件
- 读取WEB-INF下配置文件
- Spring MVC Junit测试实例 附:读取WEB-INF下配置文件的方法
- web.xml中通过contextConfigLocation的读取spring的配置文件
- Spring Junit 读取WEB-INF下的配置文件
- Spring Junit 读取WEB-INF下的配置文件
- Spring 读取WEB-INF配置文件
- Junit单元测试Spring 读取WEB-INF下的配置文件
- Junit单元测试Spring读取classes或者WEB-INF目录下的配置文件
- Spring Junit 读取WEB-INF下的配置文件
- [个人备份]读取web-inf下的配置文件
- 通过读取web.xml文件中的配置参数连接数据库(原)
- Spring Junit 读取WEB-INF下的配置文件
- Spring 读取WEB-INF配置文件
- Spring MVC Junit测试实例 附:读取WEB-INF下配置文件的方法
- Spring+Junit 读取WEB-INF上的配置文件
- WEB 项目中读取 WEB-INF 目录下配置文件的方法
- Spring MVC Junit测试实例 附:读取WEB-INF下配置文件的方法
- Junit单元测试Spring 读取WEB-INF下的配置文件
- java文件读取web-inf下的spring的xml配置文件