How to access valuestack objects within struts iterator?
- by Monika Michael
I have following code -
<s:iterator value="reviews">
<img src="<s:property value="#request.restaurant.portalImage.url" />" />
<s:property value="user.firstName" />
<s:property value="user.lastName" />
<s:property value="rating" />
<s:property value="review" />
</s:iterator>
reviews is a list of review objects which contain details of a review, such as rating and name of user.
My problem is that i'm not able to access any of the objects present on the valuestack within the loop.
Outside the loop <s:property value="#request.restaurant.portalImage.url" /> works correctly. But within the loop it prints null.
AFAIK an iterator pushes it's collection on the valuestack so that all ognl expressions resolve against it. But I've used # which means I'm explicitly specifying the root object for resolution.
Why is it still not working?