jsp填坑:找不到属性

javax.el.PropertyNotFoundException: Property [***] not found on type

接手的项目的页面是用jsp写的,虽然再有十几天就2019年了,

因为业务需求改动,需要加个字段,然后,加了字段之后,这个字段向页面传过来的这个新加的属性就是找不到,报错为:

javax.el.PropertyNotFoundException: Property [***] not found on type

后端查询返回的数据是正确的,前端页面之前能用,就加了一行属性显示,肯定是正确的,各种判断各种属性输出,还是没找到原因,直到看到了这篇……

https://stackoverflow.com/questions/8577545/javax-el-propertynotfoundexception-property-foo-not-found-on-type-com-example

这句:This literally means that the mentioned class com.example.Bean doesn't have a public (non-static!) getter method,突然反应过来,bean里定义属性时用的private,用source生成的get,set方法,所以权限也是默认的private,而页面输出时候只有是public的get才能查找到属性,

原文地址:https://www.cnblogs.com/1394htw/p/10131021.html