Ext.onready (function () {
store3 = new Ext.data.JsonStore ({
autodestroy:true,
totalproperty: ' Totle ',
URL: ' service.do ',
storeId: ' Mystore ',
root: ' Data ',
fields: [' id ', ' name ', ' PW ']
}];
var pagingtoolbar = new Ext.pagingtoolbar ({
emptymsg: "No Data",
displayinfo:true,
displaymsg: "Show from {0} Data to {1} strip data, total {2} data,
store:store3,
pagesize:50
});
var grade = new Ext.grid.GridPanel ({
title: "Data List",
store:store3,
height:300,
Bbar:pagingtoolba R,
columns: [{
header: ' id ',
dataindex: ' id ',
width:300
}, {
header: ' name ',
dat Aindex: "Name",
width:300
}, {
header: "PW",
dataindex: "PW"
}],
region: ' Center '
});
var panel = new Ext.viewport ({
layout: ' Border ',
items: [Grade]
});
action********************
protected void Service (HttpServletRequest request,
HttpServletResponse response) throws Servletexception, IOException {
List list = new ArrayList ();
for (int i = 0; i < i++) {person
p = new Person ();
P.setid ("id" + i);
P.setname ("name" + i);
P.SETPW ("PW" + i);
List.add (P);
}
StringBuffer info = new StringBuffer ();
Info.append ("{totle:2000,data:");
Info.append (Jsonarray.fromobject (list));
Info.append ("}");
System.out.println (Info.tostring ());
System.out.println ("*****dopos");
Request.setattribute ("Info", info.tostring ());
Request.getrequestdispatcher ("/info.jsp"). Forward (request, response);
info.jsp************ Note: JSP In addition to @page can not have other text
<%@ 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" >
<servlet>
<servlet-name>test</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>