@RequestMapping("/page1")
public ModelAndView editSharing(Integer id) {
ModelAndView mav=new ModelAndView();
List<Sharing> list = sharingService.list1(id);
mav.addObject("list",list);
mav.setViewName("knowledge/sharing/editsharing");
return mav;
}
在controller里面存入list,从前台取,
<div class="layui-form-item">
<label class="layui-form-label">标题</label>
<div class="layui-input-block">
<input id="password" type="text" name="name" value="${list.get(0).name }" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
</div>
</div>