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

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

 

解决:

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

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

在页面上使用

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

 

posted on 2017-01-14 12:08  _故乡的原风景  阅读(871)  评论(0编辑  收藏  举报