不知道到底是没从数据库中取出数据还是后台数据没有传送到前台,实在晕了
求各位朋友帮助 谢谢
- HTML code
<%@ page contentType="text/html; charset=GBK"%><%@ taglib uri="/WEB-INF/tlds/c-rt.tld" prefix="c"%><%@ taglib uri="/WEB-INF/tlds/fmt-rt.tld" prefix="fmt"%><% String path = request.getContextPath();%><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><link href="<%=path%>/css/main.css" rel="stylesheet" type="text/css"><link href="<%=path%>/css/a.css" rel="stylesheet" type="text/css"><title>用户信息列表</title><SCRIPT LANGUAGE="JavaScript" src="<%=path%>/common/js/prototype.js"></SCRIPT><SCRIPT LANGUAGE="JavaScript" src="<%=path%>/common/My97DatePicker/WdatePicker.js"></SCRIPT><SCRIPT LANGUAGE="JavaScript">//选中所有的复选框function checkAll(name) { var el = document.getElementsByTagName('input'); var len = el.length; for(var i=0; i<len; i++) { if((el[i].type=="checkbox") && (el[i].name==name)) { el[i].checked = true; } }}// 取消所有的复选框function clearAll(name) { var el = document.getElementsByTagName('input'); var len = el.length; for(var i=0; i<len; i++) { if((el[i].type=="checkbox") && (el[i].name==name)) { el[i].checked = false; } }}// 判断复选框是否选中了function checkChckbox(){ var obj=document.getElementsByName('idArray'); for(var i=0;i<obj.length;i++){ if(obj[i].checked) { return true; } }}function searchUser(){ $("refrush").value="true"; $("userListForm").submit();}function isnull(str) { if (str == null || str == "" || str == "undefine") { return true; } return false;} function deleteUser(id){ if(!isnull(id)){ if(confirm("确定要删除此用户吗")){ $("userListForm").action="${pageContext.request.contextPath}/deleteUser.action?id="+id; }else{ return false; } }else{ if(checkChckbox()){ if(confirm("确定要删除这些用户吗?")){ $("userListForm").action="${pageContext.request.contextPath}/deleteUser.action"; }else{ return false; } }else{ alert("请选择用户!"); return false; } } $("userListForm").submit(); } </script></head><body> <form id="userListForm" name="userListForm" action="<%=path %>/searchUser.action" method="post"> <span class="headline"> <center>用户信息列表</center> <input type="hidden" id="refrush" name="refrush" value="false" /> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="search" align="right" width="30%" nowrap>用户名:</td> <td class="search"><input type="text" id="user.userName" name="user.userName" value="${user.userName}" /></td> <td class="search" align="right" width="30%" nowrap>用户年龄:</td> <td class="search"><input type="text" id="user.age" name="user.age" value="${user.age}"/></td> <td class="search" align="right" width="30%" nowrap>用户性别:</td> <td class="search"><input type="text" id="user.sex" name="user.sex" value="${user.sex}" /></td> </tr> <td class="search" width="30%" colspan="2"> <table width="100%"> <tr> <td width="100%" align="right" nowrap class="datacell"></td> <td><input class="btn" type="button" value="查询" onclick="javascript:searchUser();"/></td> <td><input class="btn" type="button" value="添加" onclick="window.location.href='<%=path%>/toEditUser.action';" /></td> <td><input class="btn" type="button" value="删除" onclick="javascript:deleteUser('');"/></td> </tr> </table> </td> </table> <div class="search"></div><table width="100%" border="0" cellpadding="3" cellspacing="0" bordercolor="#CCCCCC" style="border-collapse: collapse" class="tableCenter"> <tr> <td colspan="3"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="dataFTop" align="left"><img src="<%=path%>/images/frame1.gif" width="6" height="6" /></td> <td class="dataFTop" align="right"><img src="<%=path%>/images/frame3.gif" /></td> </tr> </table> </td> </tr> <tr> <td class="dataFLeft1"> </td> <td class="dataFBody"> <table width="100%" cellspacing="1" cellpadding="0" class="dataTbBorder"> <tr> <td class="dataTbHead" nowrap></td> <td class="dataTbHead" nowrap>序号</td> <td class="dataTbHead" nowrap>用户名</td> <td class="dataTbHead" nowrap>用户年龄</td> <td class="dataTbHead" nowrap>用户性别</td> <td class="dataTbHead" nowrap>操作</td> </tr> <c:if test="${not empty userPage}"> <c:set var="rownum" value="${(userPage.currentPageNo-1)*userPage.pageSize}" /> <c:forEach items="${userPage.dataList }" var="userList" varStatus="index"> <c:set var="rownum" value="${rownum+1}" /> <tr> <td class="dataTb2"><input type="checkbox" name="idArray" id="idArray" style="border-width: 0; width: 15; height: 15" value="${userList.id}"></td> <td class="dataTb2">${rownum}</td> <td class="dataTb2">${userList.userName }</td> <td class="dataTb2">${userList.age }</td> <td class="dataTb2">${userList.sex }</td> <td class="dataTb2"><a href="${pageContext.request.contextPath}/toEditUser.action?id=${userList.id }"> <img src="${pageContext.request.contextPath}/images/edit_icon.gif" title="编辑" border="0"> </a> <a href="${pageContext.request.contextPath}/detailUser.action?id=${userList.id }"> <img src="${pageContext.request.contextPath}/images/search_icon.gif" title="查看" border="0"> </a><img style="cursor: hand" src="${pageContext.request.contextPath}/images/remove.gif" title="删除" border="0" onclick="deleteUser('${userList.id}');"></td> </tr> </c:forEach> </c:if> </table> </td> <td class="dataFRight1"> </td> </tr> <tr> <td colspan="3"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="dataFBottom" align="left"><img src="<%=path%>/images/frame7.gif" /></td> <td class="dataFBottom" align="right"><img src="<%=path%>/images/frame9.gif" /></td> </tr> </table> </td> </tr></table></form><jsp:include page="/common/PageController.jsp" flush="true"> <jsp:param name="curPage" value="${userPage.currentPageNo}" /> <jsp:param name="perPage" value="${userPage.pageSize}" /> <jsp:param name="totalCnt" value="${userPage.totalCount}" /> <jsp:param name="orderColumn" value="" /> <jsp:param name="orderType" value="" /></jsp:include></body></html>