[个人备份]读取web-inf下的配置文件

String path = getServletContext().getRealPath("/WEB-INF/conf.properties");
try {
InputStream is = new FileInputStream(path);
InputStreamReader reader = new InputStreamReader(is);
BufferedReader bufferedReader = new BufferedReader(reader);
StringBuffer stringBuffer = new StringBuffer();
String line;
while((line=bufferedReader.readLine())!=null)
{
stringBuffer.append(line);
}
System.out.println(stringBuffer.toString().);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
阅读更多
个人分类: java
上一篇[个人备份]获取当月最后一天的日期
下一篇[个人备份]js点击按钮进行60秒倒计时
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭