为什么点击首页,上一页,下一页,尾页的时候会跳转到一个新的页面去呢?
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/common/taglibs.jsp"%>
<%@page import="java.util.*"%>
<%@ page import="cn.com.circreport.reprint.model.ZGMiddleValue"%>
<html>
<style type="text/css">
.container{
position: absolute;
margin-top: 30px;
margin-left: 0px;
left: 0px;
}
.title{
font-size: 13px;
}
.tableFont{
font-size: 10pt ;
}
.tableTopF{
font-size: 10pt ;
font-weight: bold;
}
</style>
<script type="text/javascript">
function managePage(filed){
if(filed.name=="firstPage")
fm.pageNo.value="1";
if(filed.name=="previouPage"){
if("1"==fm.pageNo.value){
alert("当前已经是首页!")
return false;
}
fm.pageNo.value=parseInt(fm.pageNo.value)-1;
}
if(filed.name=="nextPage"){
if(fm.pageNumber.value==fm.pageNo.value){
alert("当前已经是最后一页!")
return false;
}
fm.pageNo.value=parseInt(fm.pageNo.value)+1;
}
if(filed.name=="tailPage")
fm.pageNo.value=fm.pageNumber.value;
fm.submit();
}
</script>
<body>
<div class="col-lg-12">
<form name="fm" action="/circreportnew/reprint/queryAllZgMiddleValues.do" target="fraUserSetInput">
<table style="width: 96.5%;border-style: none;">
<div align="center">
<a style="color:blue;text-decoration:none;font-size: 11pt" href="${pageContext.request.contextPath}/reprint/queryAll.do">返回资管数据查询</a>
<a style="color:blue;text-decoration:none;font-size: 11pt" href="${pageContext.request.contextPath}/reprint/ratio.do">比较上月</a>
</div>
<br/>
<tr style="background-color: #D2F0F9;" align="center">
<td class="tableTopF">YEARMONTH</td>
<td class="tableTopF">ITEMNAME</td>
<td class="tableTopF">ITEMVALUE</td>
<td class="tableTopF">ITEMCODE</td>
</tr>
<%
String yearMonth = "" ;
String itemName = "" ;
String itemValues ="";
String itemCode = "" ;
List<ZGMiddleValue> list = (List<ZGMiddleValue>)session.getAttribute("middleValueList") ;
if(null != list && list.size() >0){
for(int i = 0 ; i < list.size() ; i++){
ZGMiddleValue zgMiddleValue = (ZGMiddleValue)list.get(i);
yearMonth = zgMiddleValue.getYearMonth();
itemName = zgMiddleValue.getItemName();
itemValues = zgMiddleValue.getItemValues();
itemCode = zgMiddleValue.getItemCode();
%>
<tr style="background-color: #D2F0F9;" align="center">
<td class="tableFont"><%=yearMonth%></td>
<td class="tableFont"><%=itemName%></td>
<td class="tableFont"><%=itemValues%></td>
<td class="tableFont"><%=itemCode%></td>
</tr>
<%
}
}
%>
<tr style="background-color: #D2F0F9;">
<td colspan="2">
<input type="hidden" name="pageNo" value="${pm.page }"/>
<input type="hidden" name="pageNumber" value="${pm.totalPages }"/>
</td>
<td colspan="8" align="center">
<input type="button" name="firstPage" value="首页" onclick="managePage(this)" style="background-color: #99CCFF;height=20px;width=50px;"/>
<input type="button" name="previouPage" value="上一页" onclick="managePage(this)" style="background-color: #99CCFF;height=20px;width=50px;"/>
<input type="button" name="nextPage" value="下一页" onclick="managePage(this)" style="background-color: #99CCFF;height=20px;width=50px;"/>
<input type="button" name="tailPage" value="尾页" onclick="managePage(this)" style="background-color: #99CCFF;height=20px;width=50px;"/>
第${pm.page }页/共${pm.totalPages }页
</td>
</tr>
</table>
</form>
</div>
</body>
</html>