日期:2014-05-17  浏览次数:20750 次

springMvc的问题。。。。。。
protected ModelAndView handleRequestInternal(HttpServletRequest request,
HttpServletResponse response) throws Exception {
// TODO Auto-generated method stub
String carno=request.getParameter("carno");
String password=request.getParameter("password");
Account account=getAccount(carno,password);
Map<String,Object> model=new HashMap<String,Object>();
if(account!=null){
model.put("account", account);
return new ModelAndView(getSuccessview(),model);
}else{
model.put("error", "卡号和密码不正确");
return new ModelAndView(getFailview(),model);
}

请问返回的数据模型放在哪里了?并没有把model放在request里,为什么在页面中可以直接用${user.carno}拿到值?

------解决方案--------------------
看看spring 对ModelAndView怎么处理的就知道了