其他分享
首页 > 其他分享> > Neither BindingResult nor plain target object for bean name

Neither BindingResult nor plain target object for bean name

作者:互联网

场景:spring MVC作form提交:

Neither BindingResult nor plain target object for bean name

报错时的代码:<form:form method=“post” action=“register.html”>
修正后的代码:<form:form method=“post” action=“register.html” commandName="user>

Spring给我们提供了一个commandName属性,我们可以通过该属性来指定我们将使用Model中的哪个属性作为form需要绑定的command对象。
除了commandName属性外,指定modelAttribute属性也可以达到相同的效果。

标签:target,form,plain,object,commandName,Neither,BindingResult,属性
来源: https://blog.csdn.net/qq_41515210/article/details/115176918