标签:getparameter getattribute request getparametermap
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]); }
3.Integer.parseInt((String)request.getAttribute("page"))---int
标签:getparameter getattribute request getparametermap
原文地址:http://blog.csdn.net/jeofey/article/details/46517295