ModelAndView传参数到前端jsp页面,页面却获取不到值

后端:

        @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}


猜你喜欢

转载自blog.csdn.net/weixin_38423249/article/details/80211118