代码为:
List<Map<String, Object>> shoplist= getshop.getshops();
request.setAttribute("shops",shoplist);
System.out.println("商品信息 " + shoplist);
jsp中的代码片段:
<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>其中用控制台输出list的内容为商品信息 [{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}]
但是最终效果是网页中c:forEach的片段输出空白,即使什么内容都没有,初学者,想不出哪里出了问题了,求大神打救
List<Map<String, Object>> shoplist= getshop.getshops();
request.setAttribute("shops",shoplist);
System.out.println("商品信息 " + shoplist);
jsp中的代码片段:
<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>其中用控制台输出list的内容为商品信息 [{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}]
但是最终效果是网页中c:forEach的片段输出空白,即使什么内容都没有,初学者,想不出哪里出了问题了,求大神打救
解决方案 »
- web.xml里怎么设置文件的上传大小
- spring AOP 配置问题 急急急!!!
- 像很多搜索地图一样,我若有一张很大图用在web中,为了节省下载时间,客户端想看哪一部分,就下载哪一部分,怎么实现
- 快速开发的可视化开发平台Tersus的入门级笔记
- 大家讨论一下视频网相关的知识
- 大家帮忙看看,问什么更新到数据库中的数据是乱码?
- 请问什么是单态
- 使用MD5加密后的两个相同字符串,为什么比较却不等?
- D:\tomcat4.0.6\webapps\myweb\WEB-INF\classes 目录下有一个叫Login.class的类,我想让用户在浏览器中输入http://localhost:8080/myweb
- 请教个关于图片自动切换的问题!希望大家帮忙解决一下!
- 分布式环境Javaweb+MySQL项目如何生成指定规则的不重复订单编号呢?
- 数据库设计ID的两种设计方案,老哥们进来评价下呢
然后,c:forEach标签中,先不要任何其他标签,直接将想要的信息输出,看是否还是空白