<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'userList.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="../css/main.css">
<script type="text/javascript">
function SelectCheckBox()
{
for(i=0;i<document.selectUser.elements.length;i++)
{
if(document.all("all").checked == true)
{
document.selectUser.elements[i].checked = true;
}
else
{
document.selectUser.elements[i].checked = false;
}
}
}
</script>
</head>
<body>
<form action="#" name="selectUser">
<table width="100%">
<tr>
<th scope="col">选择</th> <th scope="col">序号</th><th scope="col">手机号</th>
</tr>
<s:iterator value="#session.users" id="id" status='st'>
<s:if test="#st.Even">
<tr bgcolor="#CCCC99">
<td><input type="checkBox" name="selectAll" /></td>
<td><s:property value="#st.index" /></td>
<td><s:property value="#id.phone" /></td>
</tr>
</s:if>
<s:else>
<tr bgcolor="#666600">
<td><input type="checkBox" name="selectAll" /></td>
<td><s:property value="#st.index" /></td>
<td><s:property value="#id.phone" /></td>
</tr>
</s:else>
</s:iterator>
</table>
全选<input type="checkbox" name="all" onClick="SelectCheckBox()">
<input type="submit" value="确认"/>
</form>
</body>
</html>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'userList.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="../css/main.css">
<script type="text/javascript">
function SelectCheckBox()
{
for(i=0;i<document.selectUser.elements.length;i++)
{
if(document.all("all").checked == true)
{
document.selectUser.elements[i].checked = true;
}
else
{
document.selectUser.elements[i].checked = false;
}
}
}
</script>
</head>
<body>
<form action="#" name="selectUser">
<table width="100%">
<tr>
<th scope="col">选择</th> <th scope="col">序号</th><th scope="col">手机号</th>
</tr>
<s:iterator value="#session.users" id="id" status='st'>
<s:if test="#st.Even">
<tr bgcolor="#CCCC99">
<td><input type="checkBox" name="selectAll" /></td>
<td><s:property value="#st.index" /></td>
<td><s:property value="#id.phone" /></td>
</tr>
</s:if>
<s:else>
<tr bgcolor="#666600">
<td><input type="checkBox" name="selectAll" /></td>
<td><s:property value="#st.index" /></td>
<td><s:property value="#id.phone" /></td>
</tr>
</s:else>
</s:iterator>
</table>
全选<input type="checkbox" name="all" onClick="SelectCheckBox()">
<input type="submit" value="确认"/>
</form>
</body>
</html>