问题描述
dt2.jsp<%@pagecontentType="text/html;charset=UTF-8"import="java.io.*,java.util.*,java.sql.*"%><%@pageimport="javax.servlet.http.*,javax.servlet.*,net.sf.json.JSONArray"%><%@pagepageEncoding="UTF-8"%><%@tagliburi="http://java.sun.com/jsp/jstl/core"prefix="c1"%><%@tagliburi="http://java.sun.com/jsp/jstl/sql"prefix="sql"%><%@tagliburi="http://www.atg.com/taglibs/json"prefix="json"%><sql:setDataSourcevar="snapshot"driver="com.mysql.jdbc.Driver"url="jdbc:mysql://127.0.0.1:3306/test"user="root"password="root"/><sql:querydataSource="${snapshot}"var="result"sql="SELECT*fromt1;"/><json:object><json:propertyname="total"value='${result.rowCount}'/><json:arrayname="rows"var="item"items="${result.rows}"><json:object><json:propertyname="NAME"value="${item.name}"/><json:propertyname="AGE"value="${item.age}"/><json:propertyname="ADR"value="${item.adr}"/></json:object></json:array></json:object>
<!DOCTYPEhtml><html><head><metacharset="UTF-8"><title>平台</title><linkid="dlink"rel="stylesheet"type="text/css"href="css/easyui.css"><linkrel="stylesheet"type="text/css"href="css/icon.css"><linkrel="stylesheet"type="text/css"href="css/color.css"><linkrel="stylesheet"type="text/css"href="css/line.css"><styletype="text/css">*{font-size:12px;}#headera{font-size:14px;}#mainwrap{margin:0;}#content{width:100%;padding:0;border:0;}</style><linkrel="stylesheet"href="css/main.css"type="text/css"/><scripttype="text/javascript"src="js/jquery-1.8.0.min.js"></script><scripttype="text/javascript"src="js/jquery.easyui.min.js"></script><scripttype="text/javascript"src="js/datagrid-detailview.js"></script><scripttype="text/javascript"src="js/easyui-lang-zh_CN.js"></script></head><body><tableid="tt3"class="easyui-datagrid"style="height:490px"data-options="url:'dt2.jsp',title:'诉求工单',fitColumns:true,view:'detailview',striped:true,sortName:'NAME',sortOrder:'asc',rownumbers:true,pagination:true,loadMsg:'正在处理,请稍候……'"><thead><tr><thfield="NAME"width="90">姓名</th><thfield="AGE"width="110"sortable="true">年龄</th><thfield="ADR"width="260"sortable="true">住址</th></tr></thead></table><scripttype="text/javascript">$(function(){$('#tt3').datagrid({view:detailview,detailFormatter:function(index,row){return'<divclass="ddv"style="padding:5px0"></div>';},onExpandRow:function(index,row){varddv=$(this).datagrid('getRowDetail',index).find('div.ddv');ddv.panel({height:100,border:false,cache:false,loadingMessage:'加载中……',href:'dt2.jsp',onLoad:function(){$('#tt3').datagrid('fixDetailRowHeight',index);}});$('#tt3').datagrid('fixDetailRowHeight',index);}});});</script><jsp:includepage="dt2.jsp"/></body></html>用到了EasyUI的datagrid插件,设置data-option的URL属性后,datagrid中无数据,单独运行dt2.jsp是可以产生正常的JSON数据的,求解?