只有商品展示,沒有數(shù)據(jù)
各位大神幫忙看看哪里錯了?
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>
<%@ page import="dao.ItemsDao" %>
<%@ page import="entity.Items" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
? <head>
??? <base href="<%=basePath%>">
?? ?
??? <title>My JSP 'index.jsp' starting page</title>
?? ?<meta http-equiv="pragma" content="no-cache">
?? ?<meta http-equiv="cache-control" content="no-cache">
?? ?<meta http-equiv="expires" content="0">?? ?
?? ?<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
?? ?<meta http-equiv="description" content="This is my page">
?? ?<!--
?? ?<link rel="stylesheet" type="text/css" href="styles.css">
?? ?-->
?? ?<style type="text/css">
?? ??? div{
?? ?????? float:left;
?? ?????? margin: 10px;
?? ??? }
?? ??? div dd{
?? ?????? margin:0px;
?? ?????? font-size:10pt;
?? ??? }
?? ??? div dd.dd_name
?? ??? {
?? ?????? color:blue;
?? ??? }
?? ??? div dd.dd_city
?? ??? {
?? ?????? color:#000;
?? ??? }
?? ?</style>
? </head>
?
? <body>
??? <h1>商品顯示頁面</h1>
??? <hr>
??? <center>
?? ??? ?<table width="750" height="60" cellspacing="0" cellpadding="0" border="0" >
?? ??? ??? ?<tr>
?? ??? ??? ??? ?<td>
?? ??? ??? ??? ?
?? ??? ??? ??? ??? ?<%
?? ??? ??? ??? ??? ??? ?ItemsDao itemDao = new ItemsDao();
?? ??? ??? ??? ??? ??? ?ArrayList<Items> list = itemDao.getArrayList();
?? ??? ??? ??? ??? ??? ?if(list!=null&&list.size()>0){
?? ??? ??? ??? ??? ??? ??? ?for(int i = 0 ; i < list.size() ; i ++){
?? ??? ??? ??? ??? ???? ??? ?Items item = new Items();
?? ??? ??? ??? ?????? %>
?? ??? ??? ??? ??? ?<div>
?? ??? ??? ??? ??? ??? ?<dl>
?? ??? ??? ??? ??? ??? ??? ?<dt>
?? ??? ??? ??? ??? ??? ??? ??? ?<a href="details.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">產(chǎn)地:<%=item.getCity() %> 價格:¥<%=item.getPrice() %></dd>
?? ??? ??? ??? ??? ??? ?</dl>
?? ??? ??? ??? ??? ?</div>
?? ??? ??? ??? ??? ?<%
?? ??? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ? %>
?? ??? ??? ??? ??? ?
?? ??? ??? ??? ?</td>
?? ??? ??? ?</tr>
?? ??? ?</table>
??? </center>
?? ?
?? ?
? </body>
</html>
2018-06-07
求解決方案
2017-03-15
求解決方案。
2017-01-03
已解決!