<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %><%
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 'showlist.jsp' starting page</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="CSS/table.css" type="text/css">
<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"> <script type="text/javascript" src="dwr/engine.js"></script>
<script type="text/javascript" src="dwr/util.js"></script>
<script type="text/javascript" src="dwr/interface/service.js"></script> <script type="text/javascript" src="js/comm.js"></script>
<style>   
  .mouseover   {   
  background-color:   #FFFFFF;   
  }   
  .mouseout   {   
  background-color:   #AAAAAA;   
  }   
 </style>
<script type="text/javascript">
function toAdd(){
document.forms[0].action+="?method=toAdd";
document.forms[0].submit();
}
function dolist(){
document.forms[0].action+="?method=dolist";
document.forms[0].submit();
}
function toDel(id)
{
document.forms[0].action+="?method=toDelete&id="+id;
document.forms[0].submit();
}
function toUpdate(id)
{
document.forms[0].action+="?method=toUpdate&id="+id;
document.forms[0].submit();
}
function   mouseover(id)   
{   
    id.className   =   "mouseover";   
}   
function   mouseout(id)   
{   
    id.className   =   "mouseout";   
}   
</script>
</head> <body>
<form method="post" action="main.do">
   
<!--  -->
<table width="100%">
<tr>
<td>
<font color="#0000CC">您正在做的业务是:数 据</font>
</td>
</tr>
</table>
<tr>
<td>
<select name="hdCorporation" 
style="SELECT_STYLE2">
<option value="1">--公司--</option>
<logic:iterate name="pb" id="list" property="currentList">
<option value="2">
${list.corporation.corporationName}
</logic:iterate>
</select>
</td>
</tr>
<tr>
<td>件  号:<input type="text" name="hdmainArticleId"></td>
<td>章节号:<input type="text" name="hdmainAta"></td>
</tr>
<td><input type="button" value="添加" onclick="javascript:toAdd();"></input></td>
<td><input type="button" value="查询" onclick="javascript:dolist();"></input></td>

<table width="100%" border="1" cellpadding=0 cellspacing=1
bordercolorlight=#848284 bordercolordark=#eeeee class="TABLE_STYLE1">

<tr align="center">
<td width="8%" class="TD_STYLE1">公司名称</td>
<td width="8%" class="TD_STYLE1">ATA章节号</td>
<td width="12%" class="TD_STYLE1">件号</td>
<td width="8%" class="TD_STYLE1">测试(工时)</td>
<td width="8%" class="TD_STYLE1">修理(工时)</td>
<td width="8%" class="TD_STYLE1">翻修(工时)</td>
<td width="8%" class="TD_STYLE1">修理(固定)</td>
<td width="8%" class="TD_STYLE1">翻修(固定)</td>
<td width="8%" class="TD_STYLE1">保修期</td>
<td width="8%" class="TD_STYLE1">周期</td>
<td width="8%" class="TD_STYLE1">报价日期</td>
<td width="8%" class="TD_STYLE1">操作</td>
</tr>
<logic:iterate name="pb" id="list" property="currentList">
<tr align="center" class="TD_STYLE2">
<td>${list.corporation.corporationName}</td>
<td>${list.articleId.articleIdAta}</td>
<td>${list.articleId.articleIdName}</td>
<td>${list.mainManhourTest}</td>
<td>${list.mainManhourRepair}</td>
<td>${list.mainManhourOverhaul}</td>
<td>${list.mainImmobilityRepair}</td>
<td>${list.mainImmobilityOverhaul}</td>
<td>${list.mainWarrantyTime}</td>
<td>${list.mainCycle}</td>
<td>${list.hddate.dateData}</td>
<td>
<a href="javascript:toUpdate('${list.mainId}');">更新</a>
<a href="javascript:toDel('${list.mainId}');">删除</a>
</td>
</tr>
</logic:iterate> </table> <table align="center" class="TD_STYLE9">
<tr>
<td>
总记录数${pb.allRecord}条记录,总页数有${pb.allPage}页,当前是${pb.currentPage}页
从第${pb.first+1}条记录到第${pb.last+1}条记录
</td>
</tr>
<tr>
<td>
<logic:equal value="1" name="pb" property="currentPage">
     首页 上一页
    </logic:equal>
<logic:greaterThan value="1" name="pb" property="currentPage">
<a href="main.do?page=1">首页</a>
<a href="main.do?page=${pb.currentPage-1}">上一页</a>
</logic:greaterThan>
<logic:equal value="${pb.allPage}" name="pb"
property="currentPage">
    下一页 尾页
    </logic:equal>
<logic:lessThan value="${pb.allPage}" name="pb"
property="currentPage">
<a href="main.do?method&list=${pb.currentPage+1}">下一页</a>
<a href="main.do?method&list=${pb.allPage}">尾页</a>
</logic:lessThan>

<input type="text" name="page" size="2">
<input type="submit" value="转到"> <a href="index.jsp">返回</a>
</td>
</tr>
</table> </form>
</body>

</html>
action 里的 
public ActionForward list(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
System.out.println("aaaaaaaaaaaaaaaa");
String scp = request.getParameter("page");
HdmainForm hf = (HdmainForm)form;
//因为JSP使用的DISPLAY标签的中文标签d-1773-p,替代了以前的page
PageBean pb = new PageBean();
pb.setAllRecord(hdmainBiz.count(hf));
pb.count(scp);
pb.setCurrentList(hdmainBiz.query(pb.getFirst(), pb.getSize(),hf));
request.setAttribute("pb", pb);
return mapping.findForward("showlist");
}uitl下 有这个PageBean的 方法一点下一页就出错,应该是页面上的下一页路径问题,但是我看了半天感觉没有错误