错误截图:


Neither BindingResult nor plain target object for bean name 'entity' available as request attribute


原因:后台返回了一个为null的对象  eg:entity = null,  导致页面用entity.getName时报  null.getSomething 错误


解决:后台返回的每一个对象都不能为null, 没有数据返回就用new   Student();  返回到页面这样就不会出现如题错误


Student student = null  -------------------------------------------> 返回到jsp时报错

Student student = new Student()-------------------------------------------> 返回到jsp时正常


相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-22
  • 2022-01-08
  • 2022-02-03
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案