struts2版本问题,用id替换var
即将如代码中的var改为id:
<s:iterator var="phone" value="#lst">
<DIV class="xh5">
<img height=105 width=80 src="#phone.picture"/><BR>
<s:property value="#phone.telname"/>
<br>价格: <s:property value="#phone.price"/><br>
<form action="addToCart.action" method="post">
数量:<input type="text" name="quantity" value="0" size="4"/>
<input type="hidden" value="1" name="telid">
<input type="image" name="submit" src="/mobilephone/picture/buy.gif"/>
</form>
</DIV>
</s:iterator>
修改后的代码:
<s:iterator id="phone" value="#lst">
<DIV class="xh5">
<img height=105 width=80 src="#phone.picture"/><BR>
<s:property value="#phone.telname"/>
<br>价格: <s:property value="#phone.price"/><br>
<form action="addToCart.action" method="post">
数量:<input type="text" name="quantity" value="0" size="4"/>
<input type="hidden" value="1" name="telid">
<input type="image" name="submit" src="/mobilephone/picture/buy.gif"/>
</form>
</DIV>
</s:iterator>