81,091
社区成员
发帖
与我相关
我的任务
分享
List<Map<String, Object>> shoplist= getshop.getshops();
request.setAttribute("shops",shoplist);
System.out.println("商品信息 " + shoplist);
<ul>
<c:forEach items="${shops}" var="shop">
<li>
<p><a href="javascript:;"><img src="${shop.simg}"></a></p>
<p><a href="javascript:;" class="name">${shop.sname}</a></p>
<p class="price"><em>¥</em>
${shop.sprice}
</p>
</li>
</c:forEach>
</ul>
商品信息 [{sid=4, sclass=213, simg=./images/content_bottom.png, sdiscount=32, sprice=6546, sname=werwer, soldprice=234}, {sid=3, sclass=444, simg=./images/content_bottom.png, sdiscount=111, sprice=222, sname=qwe, soldprice=333}, {sid=2, sclass=1, simg=./images/content_bottom.png, sdiscount=2, sprice=22, sname=asd, soldprice=33}, {sid=1, sclass=1, simg=./images/content_bottom.png, sdiscount=1, sprice=22, sname=www, soldprice=33}]
request.getRequestDispatcher("index.jsp").forward(request, response);
代码写在request.setAttribute的上面了。