level 9
ILYXS2000
楼主
java:
@RequestMapping("findUserInfo")
@ResponseBody
public JSON findUserInfo() throws Exception {
JSONObject json = new JSONObject();
UserInfo userInfo = new UserInfo();
userInfo.setUserId("1");
userInfo.setUserName("a");
userInfo.setPassword("******");
userInfo.setBirthdayStr("20150101");
userInfo.setEmail("[email protected]");
List<UserInfo> userList = new ArrayList<UserInfo>();
userList.add(userInfo);
JSONArray userJson = JSONArray.fromObject(userInfo);
json.put("rows", userJson);
json.put("total", 1);
return json;
}
jsp:
<table id="dg" title="My Users" class="easyui-datagrid" style="width: 700px; height: 250px"
url="${context}/userInfo/findUserInfo.html" toolbar="#toolbar" pagination="true" rownumbers="true"
fitcolumns="true" singleselect="true">
<thead>
<tr>
<th field="userId" width="50">
用户ID
</th>
<th field="userName" width="50">
用户名
</th>
<th field="password" width="50">
密码
</th>
<th field="birthdayStr" width="50">
出生日期
</th>
<th field="email" width="50">
邮箱
</th>
</tr>
</thead>
</table>
debug已经走进去了,也生成出来json了。前台就是不显示,为什么?
2016年01月04日 07点01分
1
@RequestMapping("findUserInfo")
@ResponseBody
public JSON findUserInfo() throws Exception {
JSONObject json = new JSONObject();
UserInfo userInfo = new UserInfo();
userInfo.setUserId("1");
userInfo.setUserName("a");
userInfo.setPassword("******");
userInfo.setBirthdayStr("20150101");
userInfo.setEmail("[email protected]");
List<UserInfo> userList = new ArrayList<UserInfo>();
userList.add(userInfo);
JSONArray userJson = JSONArray.fromObject(userInfo);
json.put("rows", userJson);
json.put("total", 1);
return json;
}
jsp:
<table id="dg" title="My Users" class="easyui-datagrid" style="width: 700px; height: 250px"
url="${context}/userInfo/findUserInfo.html" toolbar="#toolbar" pagination="true" rownumbers="true"
fitcolumns="true" singleselect="true">
<thead>
<tr>
<th field="userId" width="50">
用户ID
</th>
<th field="userName" width="50">
用户名
</th>
<th field="password" width="50">
密码
</th>
<th field="birthdayStr" width="50">
出生日期
</th>
<th field="email" width="50">
邮箱
</th>
</tr>
</thead>
</table>
debug已经走进去了,也生成出来json了。前台就是不显示,为什么?