我想请问一下关于web传值的问题,代码我贴出来,求大神指点一下
前端:
查看
/c:if
跳转页面的数据接口(跳转到这个页面,显示数据):
table.render({
elem: '#contactTable'
, height: "auto"
, url: 'contacts?groupId=${groupId}' //数据接口
, cols: [[ //表头
{field: 'realName', title: '姓名', width:'8%'}
, {field: 'duty', title: '职务', width:'8%'}
, {field: 'mobiles', title: '手机号', width:'28%'}
, {field: 'emails', title: '邮箱', width:'29%'}
, {field: 'gmtCreate', title: '添加时间', width:'12%', templet: '
, {fixed: 'right', title:'操作', width: '15%', align: 'center', toolbar: '#bar'} //这里的toolbar值是模板元素的选择器
]]
后端:
@GetMapping("/contact/index")
public ModelAndView index(Integer groupId){
ModelAndView mv = new ModelAndView("contact/index");
Group group = groupService.find(groupId);
mv.addObject("group", group);
mv.addObject("groupId", groupId);
mv.addObject("pageSize", Pages.CONTACT_PAGE_SIZE);
return mv;
}
主要的问题就是再后端钟获取不到groupId的值,这样页面就没办法进行跳转