ServletContext Properties 操作文件
摘要: FileOutputStream fos = null;
try {
new File(sc.getRealPath("WEB-INF") + "/" + optionsFilename).delete();
fos = new FileOutputStream(sc.getRealPath("WEB-INF") +
"/" + optionsFilename);
props.store(fos, null);
fos.flush();
result = "Options have been saved.";
} catch (IOException e) {
log.error("Error saving contact:");
閱讀全文
try {
new File(sc.getRealPath("WEB-INF") + "/" + optionsFilename).delete();
fos = new FileOutputStream(sc.getRealPath("WEB-INF") +
"/" + optionsFilename);
props.store(fos, null);
fos.flush();
result = "Options have been saved.";
} catch (IOException e) {
log.error("Error saving contact:");
閱讀全文
posted @ 2010-03-09 22:19 Ke 閱讀(500) | 評論 (0) 編輯