javax.el.PropertyNotFoundException: Property 'Email' not found···

1.有空格 

javax.el.PropertyNotFoundException: Property 'name' not found on type java.lang.String

在jstl标签属性中的""中间不能有空格,真实死都不知道怎么死的。

原: <c:forEach items="${userlist} " var="user">

把"${userlist} "中间的空格去掉,改为:

<c:forEach items="${userlist}" var="user">就ok了。

2.命名规范问题 https://stackoverflow.com/questions/29075213/javax-el-propertynotfoundexception-property-emailaddress-not-found-on-type-co

意思是声明类中元素时,命名有个默认规范首字母必须小写,不小写编译也会通过,但是实际上比如Email就是email。

Is the getter for EmailAddress field called getEmailAddress()? It's probably an issue with upper/lower case field names. Generally, field names should start with lower case letter (so emailAddress instead of EmailAddress), it is a globally accepted convention and a lot of frameworks depend on it while using reflection.

While it may be a major refactoring for you, you should change your fields to be lowerCamelCase and in your particular case with the getter named getEmailAddress() it should work.

As a quick workaround, try changing the expression to <c:out value="${UsersPrimary.getEmailAddress()}"></c:out>.



原文地址:https://www.cnblogs.com/Babylon/p/9078253.html