Ext.onReady (function () {store3 = new Ext.Data.JSONSTORE ({AUTODESTROY: true, totalProperty: 'totle', url: 'service.do', storeId: 'mystore', root: 'dados', campos: ['id', "name", "pw"]}); "没有数据", DisplayInfo: true, displaymsg: "显示从 {0} 条数据到 {1} 条数据 , 共 {2} 条数据", store: store3, pagageSize: 50}); var gray = new Ext.Grid.GridPanel ({"title: 数据列表", loja: store3, altura: 300: 300: 300: 300: grid.GridPanel (数据列表: "数据列表", loja: store3, altura: 300: 300: 300: 300: grid.GridPanel (数据列表: "数据列表", loja: store3, altura: 300: 300: 300: 300: grid.GridPanel (数据列表: "数据列表", loja: store3, altura: 300: 300: 300: 300: 300: 300:). "ID", DataIndEx: "ID", largura: 300}, {cabeçalho: "Nome", DataInDex: "Nome", Width: 300}, {Header: "PW", DataIndEx: "PW"}], Region: 'Center'}); Var Painel = Ext.Viex ({Layout;Ação********************
Serviço de void protegido (httpServletRequest Solicy, httpServletResponse Response) lança servletexception, ioexception {list list = new ArrayList (); para (int i = 0; i <50; i ++) {pessoa p = novo (); i); list.add (p);} stringbuffer info = novo Stringbuffer (); info.append ("{totle: 2000, dados:"); info.append (jsonarray.fromobject (list)); info.append ("}"); system.out.println (info.toString ()); system.println ("***** dopos"; info.toString ()); request.getRequestDispatcher ("/info.jsp"). Forward (solicitação, resposta);}info.jsp ************ 注意: JSP 除了 @Page 不能有其他的文字
<%@ Page Language = "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/ns/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 " Version = "2.5"> <Verlet> <Verlet-name> Test </servlet-name> <Servlet-class> com.aa.testaction </servlet-class> </servlet> <Servlet-Mapping> <Verlet-Name> Test < /servlet-name> <url-tattern>*. DO </url-tattern> </servlet-mapping> <lorde-list> <lmed-File> index.jsp </ld-Welcome-File> </lort-File-List> </web-app>