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个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问