web项目 src下的 config文件夹如何获得 在线等 有些着急 谢谢了
public static void setProperties(String key,String value){
HttpServletRequest request = ServletActionContext.getRequest();
Properties p = new Properties();
InputStream fis = null;
OutputStream fos = null;
InputStream url = WriteProperties.class.getClassLoader().getResourceAsStream("config//config.properties");
try {
File file = new File(url.toString());
if(file.exists()){
try {
//file.createNewFile();
fis = new FileInputStream(file);
p.load(fis);
fis.close();//一定要在修改值之前关闭fis
fos = new FileOutputStream("config.properties");
p.setProperty(key, value);
p.store(fos,"Update '" + key + "' value");
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
[解决办法]
没搞懂你要问什么
[解决办法]
你给人部署web还有src文件夹?你是不是还给人家安个Eclipse啊
[解决办法]
哪有在工程目录下写文件的?
[解决办法]