setAttribute,html name 取出来的值相同

request.setAttribute("news",news)和

<logic:iterate id="news" name="newsList" collection="<%=list%>">

     <html:link action="/NewsContentInit" paramId="newsId"  paramName="news" paramProperty="newsid"><bean:write name="news" property="title"/></html:link>

相当于<bean:write name="news"/>

所以如果是要取不同的数据,则要避免将其名字取成一样的。


---------------------------------------------------------------------------------------------------------------------------------
copyright:http://www.cnblogs.com/anee/
原文地址:https://www.cnblogs.com/anee/p/2675857.html