首页 > 编程语言 > 详细

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

时间:2018-05-23 18:20:20      阅读:173      评论:0      收藏:0      [点我收藏+]

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···

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!