后端:
@RequestMapping("index.do")
public ModelAndView findIndex(){
List<EasybuyProduct> list = productBiz.findBy_8Line();
ModelAndView model = new ModelAndView("forward:/index.jsp");
model.addObject("list",list);
model.addObject("name","like");
return model;
}
前端:
${name}
发现方法没错,首先对一下ModelAndView引入的包,正确的包是:org.springframework.web.servlet.ModelAndView;
错误的包是:import org.springframework.web.portlet.ModelAndView;
前端获取:${name}