ModelAndView mv = new ModelAndView();
mv.addObject("ShopPage", shop);
mv.addObject("page", page);
mv.addObject("totalPage", shop.getTotalPages());
ModelAndView mv = new ModelAndView();
mv.addObject("ShopPage", shop);
mv.addObject("page", page);
mv.addObject("totalPage", shop.getTotalPages());
收起
ModelAndView是java web的吧,最基础的东西。
ModelAndView mv = new ModelAndView();//创建一个ModelAndView对象 mv
//下面三句话都是 往mv这个对象里塞值
实际调用了这个方法
public ModelAndView addObject(String attributeName, @Nullable Object attributeValue) {
** this.getModelMap().**addAttribute(attributeName, attributeValue);
return this;
}
mv.addObject("ShopPage", shop);
mv.addObject("page", page);
mv.addObject("totalPage", shop.getTotalPages());
放到了map里。不太懂的话,建议再看看基础
报告相同问题?