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

Posted 巴啦啦大魔王

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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>.



以上是关于javax.el.PropertyNotFoundException: Property 'Email' not found···的主要内容,如果未能解决你的问题,请参考以下文章