Ext.onReady (function () {store3 = new ext.data.jsonStore ({autodestroy: true, TotalProperty: 'Totle', url: 'service.do', storeId: 'mystore', root: 'data', fields: ['id', "name", "pwar (", "leere"; "没有数据",displayInfo : true,displayMsg : "显示从{0}条数据到{1}条数据,共{2}条数据",store : store3,pageSize : 50});var grade = new Ext.grid.GridPanel({title : "数据列表",store : store3,height : 300,bbar : pagingToolbar,columns : [ {header : "id", dataindex: "id", width: 300}, {header: "name", dataindex: "name", width: 300}, {header: "pw", dataindex: "pw"}], Region: 'center'});Aktion********************
Protected void Service (HttpServletRequest -Anforderung, HttpServletResponse -Antwort) löst ServletException aus, ioException {listlist = new ArrayList (); für (int i = 0; i <50; i ++) {Person p = new Person (); P.Setid ("id" + i); i); list.add (p);} StringBuffer info = neu StringBuffer (); info.append ("{Totle: 2000, Daten:"); info.append (jsonArray.fromObject (Liste)); info.append ("}"); System.out.println (info.toString (); info.toString ()); request.getRequestDispatcher ("/info.jsp"). Forward (Request, Antwort);}info.jsp ************ 注意 : jsp 除了 @page 不能有其他的文字
<%@ page Language = "java" contentType = "text/html; charset = iSO-8859-1" PageCoding = "ISO-8859-1"%> $ {info}web.xml ***************
<? xmlns: web = "http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi: schenalocation = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"id="webapp_id " Version = "2.5"> <Servlet> <Servlet-Name> Test </Servlet-Name> <Servlet-Class> com.aa.Testaction </Servlet-Class> </Servlet> <Servlet-Mapping> <Servlet-name> Test < /servlet-name> <url-puftern>*. Do </url-pattern> </servlet-mapping> <Welcome-File-List> <Welcome-File> Index.jsp </Welcome-File> </Welcome-File-List> </web-App>