今天在项目中使用EL表达式获取对象中的属性时,出现错误
javax.el.PropertyNotFoundException: The class 'entity.User' does not have the property 'Name'.
原因如下:
使用EL获取对象属性时,属性名必须首字母小写并提供get方法,get、set方法后属性名首字母大小写均可(getName或getname都能通过,EL表达式优先使用getname)