qq_28573739 2016-08-14 10:51 采纳率: 100%
浏览 893
已采纳

easyui+springMVC显示列表问题!

前台:

 <table id="dg" title="My Users" class="easyui-datagrid" style="width:550px;height:250px"
url="regist.do"
toolbar="#toolbar"
rownumbers="true" fitColumns="true" singleSelect="true">
<thead>
<tr>
<th field="username" width="50">First Name</th>
<th field="lastname" width="50">Last Name</th>
<th field="phone" width="50">Phone</th>
<th field="email" width="50">Email</th>
</tr>
</thead>
</table>
后台

@RequestMapping(value = "regist", method = RequestMethod.POST)
public Object regist(HttpServletRequest request, User user) throws Exception {
    List<User>  userList=   userService.getUsers();
    System.out.println(userList);
    Map<String, Object> result = new HashMap<String, Object>(2) ; 
    JSONArray arr = new JSONArray();
    JSONObject obj = new JSONObject();
    for(int i =0;i<userList.size();i++){
    obj.put("username", userList.get(i).getUsername());
    arr.add(obj);
    }
    result.put("total",userList.size() );
    result.put("rows", arr);
    return JSONObject.fromObject(result);
}

debugger跳进regist方法里了 但是浏览器报jquery-1.7.2.min.js:4 POST http://localhost:8080/SpringMVC/regist.do
没找到这个方法??在问一下spring怎么返回才能把数据加载到表格里

  • 写回答

1条回答 默认 最新

  • zqbnqsdsmd 2017-02-22 15:56
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 已采纳回答 11月29日

悬赏问题

  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大