<table>
<tr height="500px">
<td>1</td>
<td width="31%">
<img src="/bs/image/111.jpg">
</td>
<td width="1%">1</td>
<td width="31%">
<img src="/bs/image/222.jpg">
</td>
<td>1</td>
</tr>
<tr height="11px"><td></td></tr>
<tr height="500px">
<td>1</td>
<td width="31%">
<img src="/bs/image/333.jpg">
</td>
<td width="1%">1</td>
<td width="31%">
<img src="/bs/image/444.jpg">
</td>
<td>1</td>
</tr>
</table>
以下为此页面的一下引用信息
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<style type="text/css">
@import"/bs/NewFile.css";
</style>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="${pageContext.request.contextPath}/jquery/jquery-1.11.3.min.js" type="text/javascript"></script>
这是原本好用的代码
以下为出问题的代码,问题出在我加入c:forEach后运行发现整个img标签都失效了,原本有图片的地方变成一个空的td,问题不在request中,因为我在request中已经存了hots,
<table>
<tr height="500px">
<td>1</td>
<td width="31%">
<c:forEach items="${hots}" var="p">
<img src="${pageContext.request.contextPath}/${p.pimage}">
</c:forEach>
</td>
<td width="1%">1</td>
<td width="31%">
<img src="/bs/image/222.jpg">
</td>
<td>1</td>
</tr>
<tr height="11px"><td></td></tr>
<tr height="500px">
<td>1</td>
<td width="31%">
<img src="/bs/image/333.jpg">
</td>
<td width="1%">1</td>
<td width="31%">
<img src="/bs/image/444.jpg">
</td>
<td>1</td>
</tr>
</table>
假如我将
<c:forEach items="${hots}" var="p">
这行代码删除,但是保留
<img src="${pageContext.request.contextPath}/${p.pimage}">
这行代码运行的话,发现tb中还是有img存在的,只不过图片没引过来而已,
所以问题就是出现在加的那个c:forEach标签中,
跪求大神!!!