testJqgrid.jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'testJqgrid.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script src="http://localhost:8080/blog/js/jquery-1.5.2.min.js"></script>
<script src="http://localhost:8080/blog/js/grid.locale-en.js"></script>
<script src="http://localhost:8080/blog/js/jquery.jqGrid.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
jQuery("#jsonmap").jqGrid({
url:'http://localhost:8080/scm/materialOut_MarketRefunding_findAllMaterial_n.action',
//url:WEB_PATH+'/excludes/post.jsp',
datatype: 'json',
colNames:['编号','姓名','密码','相片','邮箱'],
colModel:[
{name:'id',index:'id', width:90,sorttype:"int"},
{name:'username',index:'name', width:110,sorttype:"int"},
{name:'password',index:'password', width:80},
{name:'photo',index:'photo', width:80},
{name:'email',index:'email', width:80}
],
rowNum:10,
rowList:[10,20,30],
pager: "pjmap",
multiselect: false,
sortname: 'id',
viewrecords: true,
sortorder: "desc",
jsonReader: {
root: "dataRows",
repeatitems : false
},
caption: "用户列表",
height: 220
}).navGrid('pjmap',
{view:true,edit:true,add:false,del:false},
{closeOnEscape:true}
);
});
</script>
</head>
<body>
<table id="jsonmap" ></table>
<div id="pjmap" ></div>
</body>
</html>
后台action
public String findAllMaterial(){
List<MaterialStorage> ms = this.iMarketRefundingService.findAllMaterial();
for(int i=0;i<ms.size();i++){
MaterialStorage m = ms.get(i);
JSONObject student = new JSONObject();
//Map student = new HashMap();
student.put("username",m.getMaterialCode());
student.put("password",m.getMaterialName());
student.put("photo",m.getMaterialDesc());
student.put("email",m.getMaterialType());
student.put("id",i);
dataRows.add(i,student);
}
this.setTargetUrl("materialOut/marketRefunding/testJqgrid.jsp");
return RESULT_JSP;
}
结果页面上报错:

意思是第58行缺少对象。这个应该怎么改啊?