日期:2014-05-17  浏览次数:20704 次

在jsp中做真分页功能的实现,但总是提示无效的列索引,请求帮助。
在做真分页功能的实现是,总是提示无效的列索引,相同的sql语句在调用时提示无效的列索引,但在sqlplus中运行又可得到结果,先附上代码请各位老师和前辈指点。
tuser_list.jsp调用页面传入表单内容:
<%@ page contentType="text/html;charset=GBK"%>
<%@ page import="java.util.*"%>
<%@ page import="org.lxh.oracle.dao.*" %>
<%@ page import="org.lxh.oracle.dao.factory.*" %>
<%@ page import="org.lxh.oracle.vo.*" %>
<html>
<head>
<title>用户管理页面</title>
<style type="text/css">
body,td{
font-size:13px ;
}
</style>
<script language="javascript">
function changeColor(obj,color){
obj.bgColor = color ;
}
function goInsert(thisurl){
window.open(thisurl,"用户管理","width=600,height=420,scrollbars=yes,resizable=yes");
}
function goUpdate(thisurl){
window.open(thisurl,"用户管理","width=600,height=420,scrollbars=yes,resizable=yes");
}
function goDelete(thisurl){
window.open(thisurl,"用户管理","width=360,height=200,scrollbars=yes,resizable=yes");
}
</script>
</head>
<body>
<%
// 解决提交时的中文乱码问题
request.setCharacterEncoding("GBK") ;
%>
<center>
<%
int currentPage = 1 ; // 当前所在是第一页
int lineSize = 5 ; // 每页显示5条记录
int allRecorders = 0 ; // 总记录数,需要计算
List all = null ; // 保存全部的查询结果
%>
<%!
public static final String SPURL = "tuser_list.jsp" ;
%>
<%
try{
// 修改页数
currentPage = Integer.parseInt(request.getParameter("cp")) ;
}catch(Exception e){}
try{
// 修改行数
lineSize = Integer.parseInt(request.getParameter("ls")) ;
}catch(Exception e){}
%>
<h2>用户管理</h2>
<hr>
<%
// 接收查询内容
String keyWord = request.getParameter("keyWord") ;
if(keyWord==null){
keyWord = "" ;
}
%>
<h2><a href="#" onClick="goInsert('tuser_insert.jsp')">增加用户</a></h2>
<%
try{
IPersonDAO dao = DAOFactory.getIPersonDAOInstance() ;
all = dao.findAll(currentPage,lineSize,keyWord) ;
allRecorders = dao.getAllCount(keyWord) ;
%>
<jsp:include page="../split_page.jsp">
<jsp:param name="currentPage" value="<%=currentPage%>"/>
<jsp:param name="lineSize" value="<%=lineSize%>"/>
<jsp:param name="allRecorders" value="<%=allRecorders%>"/>
<jsp:param name="keyWord" value="<%=keyWord%>"/>
<jsp:param name="searchFlag" value="TRUE"/>
<jsp:param name="lineSizeFlag" value="TRUE"/>
</jsp:include>
<table border="1" width="80%" cellpadding="5" cellspacing="0" bgcolor="F2F2F2">
<tr>
<td>用户ID</td>
<td>用户姓名</td>
<td>用户类型</td>
<td colspan="2">操作</td>
</tr>
<%
Iterator iter = all.iterator() ;
int count = 0 ;
while(iter.hasNext()){
Person person = (Person)iter.next() ;
count++ ;
%>
<tr onMouseOver="changeColor(this,'white')" onMouseOut="changeColor(this,'F2F2F2')">
<td><%=person.getUserid()%></td>
<td><%=person.getEname()%></td>
<td><%=person.getPos()%></td>
<td><a href="#" onClick="goUpdate('person_update.jsp?user