1.用request.getParameterMap()获取url中的所有参数
Map map=request.getParameterMap();
Set keSet=map.entrySet();
for(Iterator itr=keSet.iterator();itr.hasNext();){
@SuppressWarnings("rawtypes")
Map.Entry me=(Map.Entry)itr.next();
Object ok=me.getKey();
Object ov=me.getValue();
String[] value=new String[1];
if(ov instanceof String[]){
value=(String[])ov;
}else{
value[0]=ov.toString();
}
System.out.println(value[0]);
}
2.request.getParameter("city")获取url中参数名为city的参数值---String
3.Integer.parseInt((String)request.getAttribute("page"))---int