关于ModelAndView
程序员文章站
2022-07-03 12:35:01
...
import org.springframework.web.servlet.ModelAndView;
@RequestMapping(value = "/goJxsjddPage")
public ModelAndView goJxsjddPage() {
ModelAndView mv = new ModelAndView();
List<String> pcbhs = pcszDao.getPcbh();
String ztbz = "";
mv.addObject("ztbz", ztbz);
mv.addObject("pcbhs", pcbhs);
mv.setViewName("gcgl/jxsjdd");
return mv;
}
引包的时候注意应引入的是org.springframework.web.servlet下边的包,而不是
import org.springframework.web.portlet.ModelAndView;的包下的ModelAndView类;