日期:2014-05-17 浏览次数:20790 次
<%@ page language="java" import="java.util.*" pageEncoding="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" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<% if(session.getAttribute("getData")==null)
{//这里只是一个跳转,没什么
session.setAttribute("getData","ok");
response.setHeader("refresh","1;url=/strutsPage/productShow.do?pageDo=first&curr_page=1");
}
%>
<html>
<head>
<title>JSP for ProductShowForm form</title>
</head>
<body><font color="#0000ff">这里仅演示分页,操作部分已经做到获取ID了,相信直接调用就可以弄修改和删除</font>
<table width="80%" border="1">
<tr>
<th>
商品名称
</th>
<th>
价格
</th>
<th>
商品描述
</th>
<th>
商品详细信息
</th>
</tr>
<logic:present name="data" scope="request">
<logic:iterate id="show" name="data" type="com.yourcompany.vo.Product">
<tr>
<td>
<bean:write name="show" property="name" />
</td>
<td>
<bean:write name="show" property="saleprice" />
</td>
<td>
<bean:write name="show" property="descript" />
</td>
<td>
<bean:write name="show" property="saledate" />
</td>
</tr>
</logic:iterate>
</logic:present>
</table>
<logic:present name="pageInfo">
第<bean:write name="pageInfo" property="curr" />页/共<bean:write name="pageInfo" property="count" />页
<html:link action="/productShow.do?pageDo=first" paramId="curr_page" paramName="pageInfo" paramProperty="curr">首页</html:link>
<logic:notEqual name="pageInfo" property="curr" value="1">
<html:link action="/productShow.do?pageDo=prv" paramId="curr_page" paramName="pageInfo" paramProperty="curr">上一页</html:link>
</logic:notEqual>
<logic:equal name="pageInfo" property="last" value="false">
<html:link action="/productShow.do?pageDo=next" paramId="curr_page"&n