<% String begin=request.getParameter("start"); String size=request.getParameter("limited"); String callback=request.getParameter("callback"); try{ int index = Integer.parseInt(begin); int pageSize = Integer.parseInt(size); /* read()){ if(!preg_match('/\.(jpg|gif|png)$/', $name)) continue; $size = filesize($dir.$name); $lastmod = filemtime($dir.$name)*1000; $images[] = array('name'=>$name, 'size'=>$size, 'lastmod'=>$lastmod, 'url'=>$dir.$name); } $d->close(); $o = array('images'=>$images); echo json_encode($o); ?> */ String json = callback+"({totalProperty:100,root:["; for (int i = index; i < pageSize + index; i++) { json += "{col1:" + i + ",col2: 'name" + i + "', col3:'descn" + i + "'}"; if (i != pageSize + index - 1) { json += ","; } } json += "]});"; System.out.println(); System.out.println(json); System.out.println(); response.getWriter().write(json); }catch(Exception e){ } %>