javax.el.PropertyNotFoundException: Property 'xxx' not found on type String

 

<tag:forEach var="currentFood" items="sessionScope.foods "varStatus="status"> </tag:forEach>

 
Stacktrace:] with root cause


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


一直提示属性xxx未找到,谷歌了一下,有些说是Bean里没有Getter/Setter方法。

最后还是找到原因了。items里的内容缺少${}

如下:

<tag:forEach var="currentFood" items="${sessionScope.foods}"varStatus="status"> </tag:forEach>

你可能感兴趣的:(jsp)