[예제]
System.out.println("url:"+request.getRequestURL() +",");
Map params = request.getParameterMap() ;
Set s = params.entrySet() ;
Iterator it = s.iterator();
while(it.hasNext()){
@SuppressWarnings("unchecked")
Map.Entry<String,String[]> entry = (Map.Entry<String,String[]>)it.next();
String key = entry.getKey();
String[] value = entry.getValue();
System.out.println("Key is "+key+"<br>");
if(value.length>1){
for (int i = 0; i < value.length; i++) {
System.out.println("<li>" + value[i].toString() + "</li><br>");
}
}else
System.out.println("Value is "+value[0].toString()+"<br>");
System.out.println("-------------------<br>");
}
<결과>
Key is my<br>
Value is lnk<br>
-------------------<br>
Key is server<br>
Value is myserver<br>
-------------------<br>
댓글 없음:
댓글 쓰기