javax.el.PropertyNotFoundException: 'newsLine' is an unknown bean property...

用了好久的forEach标签。今天帮同事调试程序看到下面异常,第一感觉应该是javabean里面的属性和页面的属性不一致导致,重复检查,确认属性没不论什么问题。没办法,实在看不出来,仅仅好自己写一个forEach,同一个list,同一个属性。没报不论什么异常,然后比較发现,报错程序里items="${getTestModule}"在$符号前加了个空格,问题就这么攻克了。顿时无语中。。。


[show] javax.el.PropertyNotFoundException: 'newsLine' is an unknown bean property
of 'java.lang.String'


<c:forEach items="${getTestModule}" var="list" varStatus="rowCounter"
		begin='0' step='1' end='10'>
		<li style="color: blue;"><a href="#" target="_blank">${list.newsLine}</a></li>
		</c:forEach>

<c:forEach items=" ${getTestModule}" var="list" varStatus="rowCounter"
		begin='0' step='1' end='10'>
		<li style="color: blue;"><a href="#" target="_blank">${list.newsLine}</a></li>
		</c:forEach>


原文地址:https://www.cnblogs.com/wgwyanfs/p/7065264.html