打印本文 打印本文 关闭窗口 关闭窗口
STRUTS+HIBERNATE+ORACLE分页
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2724  更新时间:2009/4/22 22:04:15  文章录入:mintao  责任编辑:mintao
16px; BACKGROUND-COLOR: #808080; BORDER-RIGHT-WIDTH: 0px
}
.tx1 {
BORDER-RIGHT: black 1px ridge; BORDER-TOP: black 1px ridge; FONT-SIZE: 9pt; BORDER-LEFT: black 1px ridge; WIDTH: 60pt; COLOR: #000000; BORDER-BOTTOM: #000000 1px ridge; HEIGHT: 20px
}
</STYLE>
</head>
<Script Language="JavaScript">
function gotoNext(){
var currentPage=parseInt(MessageForm.currentPage.value);
var totalPage=parseInt(MessageForm.totalPage.value);
currentPage=currentPage+1;
if(currentPage>totalPage){
currentPage=totalPage;
}
var url="message.do?currentPage="+currentPage;
alert(url);
document.location=url;
}
function gotoPrev(){
var currentPage=parseInt(MessageForm.currentPage.value);
var totalPage=parseInt(MessageForm.totalPage.value);
if(currentPage<=0){
  currentPage=0;
}else{
currentPage=currentPage-1;
}
var url="message.do?currentPage="+currentPage;
alert(url);
document.location=url;
}
function gotoTop(){

var url="message.do?currentPage=1";
alert(url);
document.location=url;
}
function gotoLast(){
var totalPage=parseInt(MessageForm.totalPage.value);
var url="message.do?currentPage="+totalPage;
alert(url);
document.location=url;
}
</Script>
<body>
<html:form name="MessageForm" action="/message.do" type="com.ecc.struts.message.formbean.MessageForm" scope="request">
<html:text property="currentPage"/></br>
<html:text property="totalPage"/></br>
</html:form>
<table>
<tr>
  <td><input value="top" type="button" onclick="gotoTop();">
<td><input value="prev" type="button" onclick="gotoPrev();">
<td><input value="next" type="button" onclick="gotoNext();">
<td><input value="last" type="button" onclick="gotoLast();">
</tr>
</table>
<table border=''''1''''>
<logic:present name="MessageForm" scope="request">
  <logic:iterate id="meisaiList" name="MessageForm" property="meisai" scope="request">
    <tr>
  <td>
   <bean:write name="meisaiList" property="label_1" />
  </td>
  <td>
  <bean:write name="meisaiList" property="label_2" />
  </td>
  <td>
  <bean:write name="meisaiList" property="label_3" />
  </td>
    </tr>
    </logic:iterate>
    </logic:present>
</table>
</body>
</html>

上一页  [1] [2] [3] 

打印本文 打印本文 关闭窗口 关闭窗口