⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 searchresult.jsp

📁 struts1 hibernate3 电子购物商城源码 加上了ANT编译.
💻 JSP
字号:
<%@ page language="java" import="java.util.List"
	contentType="text/html; charset=utf-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html>
<style type="text/css">
<!--
.STYLE4 {font-size: 14px; color: #999900; }
.STYLE5 {
	font-size: 16px;
	font-weight: bold;
	color: #666600;
}
.STYLE6 {
	font-size: 16px;
	color: #CC3366;
}
.STYLE8 {font-size: 16px; color: #CC3300; }
.STYLE9 {
	font-size: 12px;
	color: #FF9900;
}
.STYLE10 {color: #FF0000}
-->
</style>
<body>
	<span class="STYLE5">
		<p>
			搜索结果:
		</p> </span>

	<%
				int totalcount1 = ((Integer) request.getAttribute("totalcount1"))
				.intValue();//得到总的记录数
		int searchpage1 = ((Integer) request.getAttribute("searchpage1"))
				.intValue();//得到当前页数
		int searchpagesize1 = ((Integer) request
				.getAttribute("searchpagesize1")).intValue();//得到当前页数的记录数
		String search = (String) request.getAttribute("search");
		List list = (List) request.getAttribute("productlist");
		int totalpage; //定义总共的页数

		if (totalcount1 % searchpagesize1 == 0) {
			totalpage = totalcount1 / searchpagesize1;
		} else {
			totalpage = totalcount1 / searchpagesize1 + 1;
		}

		if (list.size() == 0) {
	%>
	<span class="STYLE10">对不起,找不到产品。</span>
	<%
	} else {
	%>
	
	<table border="0">

		<logic:iterate id="dd" name="productlist"
			type="dream.ourshopping.domain.Product" scope="request">
			<tr>
				<td colspan="2">
					<span class="STYLE4">名称: </span><span class="STYLE5"><bean:write
							name="dd" property="name" /> </span>
				</td>
			</tr>

			<tr>
				<td width="210">
					<IMG width="130" height="80" src="<bean:write name="dd" property="image" />" />
				</td>
				<td width="408">
					<table border="0">

						<tr>
							<td width="180">
								<span class="STYLE4">市场价格:</span><span class="STYLE6">
								<bean:write
										name="dd" property="price" /> </span>
						  </td>
							<td width="180" >
							<a href="jump.do?action=detail&num=<%=dd.getId() %>">	<div class="STYLE4">
									详情
								</div></a>
						  </td>

						</tr>
						<tr>
							
							<td>
								<span class="STYLE4">会员价:</span><span class="STYLE8"><bean:write
										name="dd" property="saleprice" /> </span>
							</td>
							<td >
								<a href="payon.do?num=<%=dd.getId() %>"><span class="STYLE4">定购</span> </a>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr><td colspan="2"></td></tr>
			<tr><td colspan="2"></td></tr>
		</logic:iterate>
	</table>


<span class="STYLE9">第<%=searchpage1 %>页/总共<%=totalpage %>页</span>
	<div align="center">
		<span class="STYLE9"> <%
 if (searchpage1 != 1) {
 %> <a
			href="searchcontext.do?search=<%=search%>&searchpage=<%=searchpage1 - 1%>&searchpagesize=4">上一页</a>
			<%
			} else {
			%> 上一页 <%
			}
			%> | <%
			if (totalpage > searchpage1) {
			%> <a
			href="searchcontext.do?search=<%=search%>&searchpage=<%=searchpage1 + 1%>&searchpagesize=4">下一页</a>
			<%
			} else {
			%> 下一页 <%
				}
				}
			%> </span>
	</div>

</body>
</html:html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -