gb风起云淡
2015-02-25 19:52
<%@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()%> 价格:<%=item.getPrice()%></dd>
</dl>
</div> <%
}
}
%>
</td>
</tr>
</table>
</center>
</body>
</html>
为什么会出现上面的错误!请老师指点,
这个是没有找到页面,检查下tomcat是否启动,url地址是否写错。
JAVA遇见HTML——JSP篇
248277 学习 · 3071 问题
相似问题