码迷,mamicode.com
首页 > 编程语言 > 详细

springmvc 错误:Neither BindingResult nor plain target object for bean name 'command' available as request attribute

时间:2017-01-14 13:45:56      阅读:227      评论:0      收藏:0      [点我收藏+]

标签:new   action   handler   neither   model   ring   mvc   页面   cti   

原因:springmvc默认页面回显,必须在页面的请求域里面添加对应的bean 默认的bean name为command

 

解决:

在handler里面添加一个对应的bean

map.put("employee", new Employee());

在页面上使用

<form:form action="emp" method="POST" modelAttribute="employee">

 

springmvc 错误:Neither BindingResult nor plain target object for bean name 'command' available as request attribute

标签:new   action   handler   neither   model   ring   mvc   页面   cti   

原文地址:http://www.cnblogs.com/hy87/p/6285037.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!