获得商品详情的时候,总是报错。The method getItemsById(int) is undefined for the type ItemsDAO
<%@ page language="java" import="java.util.*"
contentType="text/html; charset=utf-8"%>
<%@ page import="entity.Items"%>
<%@ page import="dao.ItemsDAO"%>
<%
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 'detail.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">
img {
border: 1px solid black;
height: 140px;
width: 180px;
}
</style>
</head>
<body>
<h1>商品详情</h1>
<hr>
<center>
<table width="750" height="60" cellpadding="0" cellspacing="0"
border="0">
<tr>
<td>
<%
ItemsDAO itemsDao = new ItemsDAO();
Items item = itemsDao.getItemsById(Integer.parseInt(request.getParameter("id")));
if(item != null)
{
%>
<table>
<tr>
<td rowspan="4"><img alt="运动鞋" src="images/<%=item.getPicture() %>"></td>
</tr>
<tr>
<td><big><%=item.getName() %></big></td>
</tr>
<tr>
<td>产地:<%=item.getCity() %></td>
</tr>
<tr>
<td>价格:<%=item.getPrice() %></td>
</tr>
</table>
<%
}
%>
</td>
</tr>
</table>
</center>
</body>
</html>