ext.onready (function () {store3 = new ext.data.jsonstore ({autodestroy: จริง, รวมทั้งหมด: 'totle', url: 'service.do', storeId: 'mystore', root: 'data', ฟิลด์: [id ', "ชื่อ", "pw"] "没有数据", displayInfo: true, displaymsg: "显示从 {0} 条数据到 {1} 条数据, 共 {2} 条数据", store: store3, pagesize: 50}); var grade = new ext.grid.gridpanel ({title: "数据列表" "id", datainedex: "id", ความกว้าง: 300}, {header: "name", datainedex: "ชื่อ", ความกว้าง: 300}, {header: "pw", dataindex: "pw"}], ภูมิภาค: 'center'};การกระทำ********************
บริการโมฆะที่ได้รับการป้องกัน (คำขอ httpservletrequest, การตอบสนอง httpservletResponse) พ่น servletexception, ioexception {list list = new ArrayList (); สำหรับ (int i = 0; i <50; i ++) {บุคคล p = บุคคลใหม่ () p.setid (" + i); i); list.add (p);} stringbuffer info = new StringBuffer (); info.append ("{totle: 2000, ข้อมูล:"); info.append (jsonarray.fromobject (รายการ)); info.append ("}"); system.out.println (info.toString ()); info.toString ()); request.getRequestDispatcher ("/info.jsp"). forward (คำขอ, ตอบกลับ);}info.jsp ************ 注意 JSP 除了 @Page 不能有其他的文字
<%@ page language = "java" contentType = "ข้อความ/html; charset = iso-8859-1" pageencoding = "iso-8859-1"%> $ {info}web.xml ***************
<? xml version = "1.0" การเข้ารหัส = "utf-8"?> <web-app xmlns: xsi = "http://www.w3.org/2001/xmlschema-instance" xmlns = "http://java.sun.com/xml xmlns: web = "http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi: schemalocation = "http://java.sun.com/xml/ns/javaeee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"id="webapp_id " เวอร์ชัน = "2.5"> <servlet> <servlet-name> ทดสอบ </servlet-name> <servlet-lass> com.aa.testaction </servlet-lass> </servlet> <servlet-mapping> <servlet-name> ทดสอบ < /servlet-name> <url-pattern>*. ทำ </url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file> index.jsp </welcome-file>