當前位置:成語大全網 - 新華字典 - jquery easyui datagrid 通過spring2.5.6 mvc 來傳輸數據,頁面url改如何寫,Controller裏面如何寫?

jquery easyui datagrid 通過spring2.5.6 mvc 來傳輸數據,頁面url改如何寫,Controller裏面如何寫?

我也用springMVC寫的代碼,壹般Controller裏面這麽寫的:

@RequestMapping(value = "/mng/getappinfo", method = RequestMethod.POST)

@ResponseBody //別人跟我說加了這行返回json數據,不加只有上面那行會返回壹個頁面

public griddata getAppInfo(

@RequestParam(value = "user", required = false) String user,

@RequestParam(value = "roleid", required = false) String roleid){

griddata gdata = new griddata(appInfoService.getAppInfo(user));//這裏從數據庫獲取字段,是個list

return gdata;

}

// 下面這個是griddata的類

public class griddata {

public griddata() {

super();

}

public griddata(List rows) {

super();

this.rows = rows;

}

private List rows;

public List getRows() {

return rows;

}

public void setRows(List rows) {

this.rows = rows;

}

}

js裏面的代碼應該都差不多

可以參考壹下我這邊的寫法