Ext.Onready(function(){store3 = new ext.data.jsonstore({autodestroy:true、totalproperty: 'totle'、url: 'service.do'、storeid: 'mystore'、 'data'、fields:['id'、 "name"、 "pw"]}); "没有数据"、displayinfo:true、displaymsg: "显示从{0}条数据到{1}条数据、共{2}条数据"、store:store3、pagesize:50}); var grade = new ext.gridpanel({title: "数据列表"、store:store:store:height:300、bbar:pagingtulbar、coluns、 "id"、dataindex: "id"、width:300}、{header: "name"、dataindex: "name"、width:300}、{header: "pw"、dataindex: "pw"}]、領域: 'center'}); varパネル= var ext。アクション********************
保護されたボイドサービス(httpservletrequestリクエスト、httpservletresponse応答)throws servletexception、ioexception {list list list = new arraylist(); for(int i = 0; i <50; i ++){人P = new人(); p.setid( "id" + i); i); list.add(p);} stringbuffer info = new StringBuffer(); info.Append( "{totle:2000、data:"); info.append(jsonarray.fromobject(list)); info.append( "} out.out.println(info.tostring()); system.out.println(" info.toString()); request.getRequestDispatcher( "/info.jsp")。info.jsp ************注意:jsp @page不能有其他的文字
<%@ページ言語= "java" contentType = "text/html; charset = iso-8859-1" pageencoding = "iso-8859-1"%> $ {info}web.xml ***************
<?xml version = "1.0" encoding = "utf-8"?> <web-app xmlns:xsi = "http://www.w3.org/2001/xmlschema-instance" xmlns = "http://java.sun.com/xml/nns/javaee xmlns:web = "http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"id="webapp_id "バージョン= "2.5"> <Servlet> <Servlet-Name>テスト</servlet-name> <servlet-class> com.aa.testaction </servlet-class> </servlet> <servlet-mapping> <servlet-name> test < /servlet-name> <url-pattern>*。do</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file> index.jsp </welcome-file> </welcome-file-list> </web-app>