<script type="text/javascript">
//分页按钮处理
function goPageAction(page){
var form = document.getElementById(
"searchForm");
form.action = "accountSearch.action?page="+page;
form.submit();//提交搜索表单
return false;//阻止href动作
}
</script>
Struts2 可以实现
<div id="pages">
<a href="javascript:;" onclick="goPageAction(1)">首页</a>
<s:if test="page>1">
<a href="javascript:;" onclick="goPageAction(${page-1 })">上一页</a>
</s:if>
<s:else>
<a href="#">上一页</a>
</s:else>
<s:iterator value="new int[maxPage]" status="i">
<s:if test="#i.count == page">
<a href="javascript:;" class="current_page" href="#" onclick="goPageAction(${i.count })">
<s:property value="#i.count"/>
</a>
</s:if>
<s:else >
<a href="javascript:;" onclick="goPageAction(${i.count })">
<s:property value="#i.count"/>
</a>
</s:else>
</s:iterator>
<div>
<c:choose>
<c:when test="page >1">
<a href="javascript:;" onclick="goPageAction(${page-1 })">上一页</a>
</c:when>
<c:otherwise>
<a href="#">上一页</a>
</c:otherwise>
</c:choose>
在jstl里面 page的值取不到