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啊
------解决方案--------------------哪有在工程目录下写文件的?
------解决方案--------------------
------解决方案--------------------楼主这问题忒纠结,看不懂你想问什么。到底是想在工程里写文件,先获得工程路径然后写文件名。还是在服务器中?    这俩个是不一样的,你把项目部署到服务器中跟你用System.out.println打印出来的结果是不一样的。虽然是同一句代码Class.getClassLoader().getResourceAsStream("config//config.properties");
,但是它的值不一样了。