123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <%
- 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);
- /*
- <?
- $dir = "images/thumbs/";
- $images = array();
- $d = dir($dir);
- while($name = $d->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: '<a href=\"www.sohu.com\" target=_blank >name</a>" + 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){
- }
- %>
|