Neither BindingResult nor plain target object for bean name 'entity' available as request attribute
2017-06-20 13:03
399 查看
错误截图:
![](https://img-blog.csdn.net/20170620125900479?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcXFfMzIyMTc1MTk=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
原因:后台返回了一个为null的对象 eg:entity = null, 导致页面用entity.getName时报 null.getSomething 错误
解决:后台返回的每一个对象都不能为null, 没有数据返回就用new Student(); 返回到页面这样就不会出现如题错误
Student student = null -------------------------------------------> 返回到jsp时报错
Student student = new Student()-------------------------------------------> 返回到jsp时正常
原因:后台返回了一个为null的对象 eg:entity = null, 导致页面用entity.getName时报 null.getSomething 错误
解决:后台返回的每一个对象都不能为null, 没有数据返回就用new Student(); 返回到页面这样就不会出现如题错误
Student student = null -------------------------------------------> 返回到jsp时报错
Student student = new Student()-------------------------------------------> 返回到jsp时正常
相关文章推荐
- Neither BindingResult nor plain target object for bean name 'member' available as request attribute
- Neither BindingResult nor plain target object for bean name 'command' available as request attribute
- Neither BindingResult nor plain target object for bean name 'mailor' available as request attribute
- Neither BindingResult nor plain target object for bean name 'command' available as request attribute
- Neither BindingResult nor plain target object for bean name 'command' available as request attribute
- Neither BindingResult nor plain target object for bean name 'command' available as request attribute
- Neither BindingResult nor plain target object for bean name 'sqmy' available as request attribute
- Neither BindingResult nor plain target object for bean name 'subjectDict' available as request attri
- Neither BindingResult nor plain target object for bean name 'command' available as request attribut
- Neither BindingResult nor plain target object for bean name 'TeachLab' available as request attribut
- Neither BindingResult nor plain target object for bean name 'internationalMakePrice' available as re
- spring MVC做form提交Neither BindingResult nor plain target object for bean name 'command' available
- Neither BindingResult nor plain target object for bean name 'user' available
- Neither BindingResult nor plain target object for bean name 'xydj' available
- java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'user'
- spring3 页面form标签 报错 Neither BindingResult nor plain target object for bean name "company"
- java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'user'
- SpringMVC表单标签出现错误:Neither BindingResult nor plain target object for bean name 'command' available as
- 使用springframework标签报错:Neither BindingResult nor plain target object for bean name 'command' availabl
- spring页面form标签 报错 Neither BindingResult nor plain target object for bean name "company"