问答详情
源自:8-7 商品详细信息显示

显示所有商品出现错误

<%@page import="java.util.ArrayList"%>

<%@ page language="java" contentType="text/html; charset=utf-8"

pageEncoding="utf-8"%>

<%@ page import="dao.itemsDAO"%>

<%@ page import="entity.items"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>Insert title here</title>

<style type="text/css">

div {

float: left;

margin: 10px;

}


div dd {

margin: 0px;

font-size: 10px;

}


div dd.dd_name {

color: blue;

}


div dd.dd_city {

color: #000;

}

</style>

</head>

<body>

<h1>商品展示</h1>

<hr>

<center>

<table width="750" height="60" cellpadding="0" cellspacing="0"

border="0">

<%

itemsDAO itemsDao = new itemsDAO();

ArrayList<items> list = itemsDao.getAllItems();

if (list != null && list.size() > 0) {

for (int i = 0; i < list.size(); i++) {

items item = list.get(i);

%>

<tr>

<td>

<div>

<dl>

<dt>

<a href="detail.jsp?id=<%=item.getId()%>"><img

src="images/<%=item.getPicture()%>>" width="120" height="90"

border="1"></a>

</dt>

<dd class="dd_name"><%=item.getName()%></dd>

<dd class="dd_city"><%=item.getCity()%>&nbsp;&nbsp;&nbsp;价格:<%=item.getPrice()%></dd>


</dl>

</div> <%

  }

  }

 %>

</td>

</tr>

</table>

</center>

</body>

</html>

http://img.mukewang.com/54edb717000189a009240240.jpg

为什么会出现上面的错误!请老师指点,

提问者:gb风起云淡 2015-02-25 19:52

个回答

  • 好帮手慕珊
    2015-02-26 09:37:43

    这个是没有找到页面,检查下tomcat是否启动,url地址是否写错。