Tuesday, 7 October 2008

Get All parameter (key and value)

Enumeration ss = request.getParameterNames();

while(ss.hasMoreElements()) {

String key = (String)ss.nextElement();
String value = request.getParameter(key);
System.out.println(key + " : " + value+"
");
}

// if value is array type such as check box
/*
String test[] = request.getParameterValues("test");

if(test != null) {
for(int i=0; i < test.length; i++) {
System.out.println("test[" + i + "] : " + test[i] );
}
}
*/

1 comment:

Anonymous said...

thanks for the page.