当前位置: 代码迷 >> Java Web开发 >> springMvc的有关问题。
  详细解决方案

springMvc的有关问题。

热度:8824   发布时间:2013-02-25 21:13:35.0
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怎么处理的就知道了
  相关解决方案