public static int queryGetInt(HttpRequest req, String key, int def)
	{
		int ret = def;
		String val = null;
		if(req.method().equals("GET"))
			val = req.queryParam(key);
		else if(req.method().equals("POST"))
			val = req.postParam(key);
		if(val != null)
			try
			{
				ret = Integer.parseInt(val);
			}
			catch(NumberFormatException e)
			{
				log.debug(e.toString(), e);
			}

		return ret;
	}