📄 userlistpage.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:if test="${requestScope.users == null}">
<jsp:forward page="./FindAllAction.action">
<jsp:param name="method" value="query" />
</jsp:forward>
</c:if>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<script type="text/javascript" language="javascript">
var j=1;
function selectAll(){
if(j%2==1){
var chks = document.all.tags("INPUT");
for(var i=0;i<chks.length;i++)
{
if(chks[i].type.toLowerCase() == "checkbox")
{
chks[i].checked = true;
}
}
}
if(j%2==0){
var chks = document.all.tags("INPUT");
for(var i=0;i<chks.length;i++)
{
if(chks[i].type.toLowerCase() == "checkbox")
{
chks[i].checked = false;
}
}
}
j++;
}
</script>
<style>
<!-- /* PR-CSS */
.mytable {
border-collapse: collapse;
border: solid #2E64A0;
border-width: 1px 0 0 1px;
}
.mytable td {
border: solid #2E64A0;
border-width: 0 1px 1px 0;
font-family: "Verdana,宋体";
font-size: 12px;
color: #000;
text-align: center;
padding: 5px;
}
.t1 {
background-color: #EDF2F7;
} /* 第一行的背景色 */
.t2 {
background-color: #ffffff;
} /* 第二行的背景色 */
.t3 {
background-color: #E0E5F0;
} /* 鼠标经过时的背景色 */
body {
text-align: center;
}
#box {
margin: 100px
}
-->
</style>
<style type="text/css" media="screen">
<
head> <base href ="<%=basePath%> "> <title>My JSP 'MyJsp.jsp '
starting page
</title> <meta http-equiv ="pragma " content ="no-cache "> <meta http-equiv
="cache-control " content ="no-cache "> <meta http-equiv ="expires " content
="0"> <meta http-equiv ="keywords " content ="keyword1,keyword2,keyword3
"> <meta http-equiv ="description " content ="This is my page "><!--
<link rel
="stylesheet " type ="text /css" href ="styles.css ">--> </head> <style type
="text /css">a:link {
color: #FF0000;
text-decoration: none
} /* 未访问的链接 */
a:visited {
color: #00FF00;
text-decoration: none
} /* 已访问的链接 */
a:hover {
color: #FF00FF;
text-decoration: underline
} /* 鼠标在链接上 */
a:active {
color: #0000FF;
text-decoration: underline
} /* 激活链接 */
</style>
<body>
<head>
</head>
<body background="images/5.jpg">
<form name="deleteForm" id="deleteForm" action="/sshtest/delete.do"
method="post">
<table width="1970" cellspacing="1" bgcolor="#336699" class=mytable
id="tab">
<tr bgcolor="#CCCCCC" align="center">
<c:if test="${requestScope.delete}">
<td width="50" height="30" align="center">
<input type="checkbox" name="id_all" id="id_all"
onclick="selectAll()">
</td>
</c:if>
<td width="50">
ID
</td>
<td width="100">
用户名
</td>
<td width="100">
密码
</td>
<td width="50">
性别
</td>
<td width="100">
出生年月
</td>
<td width="150">
电子邮件
</td>
<td width="100">
电话号码
</td>
<td width="150" align="center">
身份证号
</td>
<td width="200">
密码保护问题1
</td>
<td width="200">
密码保护回答1
</td>
<td width="200">
密码保护问题2
</td>
<td width="200">
密码保护回答2
</td>
<td width="70">
权限等级
</td>
<c:if test="${requestScope.add}">
<td width="50">
处理
</td>
</c:if>
</tr>
<c:forEach items="${requestScope.users}" var="user">
<tr bgcolor="#FFFFFF" align="center">
<c:if test="${requestScope.delete}">
<td>
<input type="checkbox" name="id" value="${user.id}">
</td>
</c:if>
<td>
${user.id}
</td>
<td height="30">
${user.username}
</td>
<td>
${user.password}
</td>
<td>
${user.sex}
</td>
<td>
${user.birthday}
</td>
<td>
${user.email}
</td>
<td>
${user.telephone}
</td>
<td>
${user.card}
</td>
<td>
${user.questionone}
</td>
<td>
${user.answerone}
</td>
<td>
${user.questiontwo}
</td>
<td>
${user.answertwo}
</td>
<td>
${user.popedom_id}
</td>
<c:if test="${requestScope.add}">
<td>
<a
href="${pageContext.request.contextPath}/findAll.do?usermethod=edit&id=${user.id}"
onClick="return confirm('真的要修改?')">改</a>
</c:if>
<c:if test="${requestScope.delete}">
<a
href="${pageContext.request.contextPath}/findAll.do?usermethod=delete&id=${user.id}"
onclick="return confirm('真的要删除?')">删</a>
</c:if>
</td>
</tr>
</c:forEach>
<tr bgcolor="#BBBBBB">
<input type="hidden" name="usermethod" value="deleteAll">
<c:if test="${requestScope.delete}">
<td>
<input type="submit" value="删除">
</td>
</c:if>
</form>
<td colspan="5" align="center">
<c:if test="${requestScope.page.hasPreviousPage}">
<a
href="${pageContext.request.contextPath}/userlist.do?pagemothed=firstPage">第一页</a>
   
<a
href="${pageContext.request.contextPath}/userlist.do?pagemothed=previousPage">上一页</a>
</c:if>
   
<c:if test="${requestScope.page.hasNextPage}">
<a
href="${pageContext.request.contextPath}/userlist.do?pagemothed=nextPage">下一页</a>
   
<a
href="${pageContext.request.contextPath}/userlist.do?pagemothed=lostPage">最后页</a>
</c:if>
</td>
<form
action="${pageContext.request.contextPath}/userlist.do?pagemothed=skiptopage"
method="post">
<td colspan="2" align="center">
第
<input type="text" name="skiptopage"
value="${requestScope.page.currentPage}" size="10" align="right">
页
<input type="submit" value="跳转">
</td>
<td colspan="2" align="center">
共分${requestScope.page.totalPages}页显示,当前是${requestScope.page.currentPage}页.
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<c:if test="${requestScope.add}">
<td>
</td>
</c:if>
</tr>
</table>
<script type="text/javascript">
<!--
var Ptr=document.getElementById("tab").getElementsByTagName("tr");
function $() {
for (i=1;i<Ptr.length+1;i++) {
Ptr[i-1].className = (i%2>0)?"t1":"t2";
var TRsel = Ptr[i-1].getElementsByTagName("select");
for(var k=0; k<TRsel.length;k++){
TRsel[k].className = Ptr[i-1].className;
}
}
}
window.onload=$;
for(var i=0;i<Ptr.length;i++) {
Ptr[i].onmouseover=function(){
this.tmpClass=this.className;
this.className = "t3";
var TRsel = this.getElementsByTagName("select");
for(var k=0; k<TRsel.length;k++){
TRsel[k].className = this.className;
}
};
Ptr[i].onmouseout=function(){
this.className=this.tmpClass;
var TRsel = this.getElementsByTagName("select");
for(var k=0; k<TRsel.length;k++){
TRsel[k].className = this.className;
}
};
}
//-->
</script>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -