extjs分页使用jsp传递数据示例_extjs
来源:动视网
责编:小采
时间:2020-11-27 21:25:42
extjs分页使用jsp传递数据示例_extjs
extjs分页使用jsp传递数据示例_extjs: 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({ em
导读extjs分页使用jsp传递数据示例_extjs: 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({ em

action********************
protected void service(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
List list = new ArrayList();
for (int i = 0; i < 50; 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************注意: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"?>
test
com.aa.TestAction
test
*.do
index.jsp
extjs分页使用jsp传递数据示例_extjs
extjs分页使用jsp传递数据示例_extjs: 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({ em