📄 list.jsp
字号:
<%@ page language="java" import="java.util.*,java.text.NumberFormat" pageEncoding="GBK"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String contextPath = request.getContextPath();
%>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<title>商品列表</title>
<link href="<%=contextPath%>/css/css.css" type="text/css" rel="stylesheet" />
<script>
function doQuery(){
var title = document.getElementById("title").value;
location.href="itemServlet?title="+title;
}
function dobuy(id){
location.href="<%=contextPath%>/carServlet?task=add&itemid="+id;
}
</script>
<tr>
<div width=100% align="center">
<td><a class="head">商品名称</a>: <input size="50" type="text" name="title" value="${param.title}" class="button"></td>
<td> <input type="button" value="查询" onclick="doQuery()"></td>
</div>
</tr>
<br>
<table align="center" width=100% border=0 >
<tr >
<td align="center">商品图片</td>
<td align="center">商品描述</td>
</tr>
<tr><td colspan=2><hr></td></tr>
<c:if test="${requestScope.result==null}">
<tr>
<td colspan="2" align="center" class="STYLE1">对不起,没有符合的商品!</td>
</tr>
</c:if>
<c:forEach var="item" items="${requestScope.result}">
<tr >
<c:if test="${item.filepath!=null}">
<td width="130" height="140"><A href="${pageContext.request.contextPath}/${item.filepath}" target="_blank"><img name="ds" src="${pageContext.request.contextPath}/${item.filepath}" width="130" height="140" alt=""></A></td>
</c:if>
<c:if test="${item.filepath==null}">
<td width="130" height="140"><A href="${pageContext.request.contextPath}/upload/nothing.jpg" target="_blank"><img name="ds" src="${pageContext.request.contextPath}/upload/nothing.jpg" width="130" height="140" alt=""></A></td>
</c:if>
<td>
<a >商品名称</a>: ${item.title}<br><br>
<a >商品描述</a>: ${item.content}<br><br>
<a >商品价格</a>: <a class="STYLE1">${item.viewPrice}</a><br><br>
<a href="${pageContext.request.contextPath}/itemServlet?task=itemshow&itemid=${item.itemid}" target="mainFrame""><b>商品详细</b></a>
<a href="javaScript:dobuy('${item.itemid}')"><b>放入购物车</b></a>
</td>
</tr>
<tr><td colspan=2><hr></td></tr>
</c:forEach>
</table>
${mpage.pageBar}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -