jsp页面上定义了查询的JS函数
function searchData() {
var ffirstname=$("#ffirstname").val().trim();
var TUserCustom;
$('#user').datagrid('reload', {
ffirstname : TUserCustom.ffirstname
});
}
后台的Controller也写好了查询数据库的方法,但是定义了个包装类userQueryVo,userQueryVo里面定义了TUserCustom类,TUserCustom类才有ffirstname 这个属性,想用TUserCustom.ffirstname这种方式来传参数但是报JS错误:Uncaught ReferenceError: TUserCustom is not defined
后台的Controller:
@ResponseBody
@RequestMapping("/queryTUserJson")
public Map<String, Object> queryTUserJson(HttpServletRequest request,UserQueryVo userQueryVo) throws Exception {
Map<String, Object> resultMap = new HashMap<String, Object>();
resultMap.put("total", 11);
resultMap.put("rows", this.tUserService.findUserList(userQueryVo));
return resultMap;
}
小弟刚刚毕业,技术不是很好,希望大家能够帮助一下~~
"userQueryVo.ffirstname": ffirstname我试了,后台还是取不到参数
追答public Map queryTUserJson(HttpServletRequest request, @ModelAttribute UserQueryVo userQueryVo) throws Exception {}
试试呢