?? select.jsp
字號:
<%@page contentType="text/html; charset=GBK"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<html>
<head>
<title>select</title>
<script type="javaScript">
function submitForm()
{
if(document.form1.selectValue.value=="")
{
alert("請輸入查找關鍵字");
document.form1.selectValue.focus();
return false;
}else
{
return true;
}
}
function toPage()
{
if(document.form1.pageText.value=="")
{
alert("請輸入要前往的頁數");
document.form1.pageText.focus();
return false;
}else
{
a=document.form1.pageText.value;
if(a<=0||a>=${requestScope.pagecount})
a=${requestScope.page}
document.form1.action = "selectservlet?page="+a+"&selectValue=${requestScope.selectValue}";
return true;
}
}
</script>
</head>
<body bgcolor="#ffffff">
<jsp:include flush="false" page="index.jsp"/>
<center>
<form name="form1" action="selectservlet" method="POST" onreset="javascript:document.form1.selectValue.value=${requestScope.selectValue}">
<table>
<tr>
<td>輸入查詢的關鍵字</td>
<td>
<input type="text" name="selectValue" value="${requestScope.selectValue}"/>
</td>
<td>
<input type="submit" onclick="submitForm()" value="查詢"/>
<input type="button" onclick="selectAll()" value="察看全部"/>
</td>
</tr>
</table>
<c:if test="${not empty sessionScope.selectList}">
<table border="1" cellpadding="3" cellspacing="3">
<tr>
<th>編號</th>
<th>名字</th>
<th>公司</th>
<th>歌手</th>
<th>類型</th>
<th>操作</th>
</tr>
<c:forEach var="cdbean" items="${sessionScope.selectList}">
<tr>
<td>${cdbean.cdId} </td>
<td>${cdbean.cdName} </td>
<td>${cdbean.cdCompany} </td>
<td>${cdbean.cdAlbum} </td>
<td>${cdbean.cdType} </td>
<td>
<a onclick="javascript:window.open('editservlet?id=${cdbean.cdId}','jszx','width=650,height=500,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');">編輯</a>
<a onclick="javascript:window.open('del.jsp?id=${cdbean.cdId}','jszx','width=200,height=300,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');">刪除</a>
</td>
</tr>
</c:forEach>
</table>
<table>
<tr>
<td>
<a href="selectservlet?action=frist&selectValue=${requestScope.selectValue}">首頁</a>
</td>
<td>
<c:if test="${requestScope.page==1}">上一頁</c:if>
<c:if test="${requestScope.page!=1}">
<a href="selectservlet?action=next&page=${requestScope.page-1}&selectValue=${requestScope.selectValue}">上一頁</a>
</c:if>
</td>
<td>
<c:if test="${requestScope.page==requestScope.pagecount}">下一頁</c:if>
<c:if test="${requestScope.page!=requestScope.pagecount}">
<a href="selectservlet?action=next&page=${requestScope.page+1}&selectValue=${requestScope.selectValue}">下一頁</a>
</c:if>
</td>
<td>
<a href="selectservlet?action=last&selectValue=${requestScope.selectValue}">尾頁</a>
</td>
<td>${requestScope.page} /
${requestScope.pagecount} </td>
<td> 轉到
<input type="text" size="2" name="pageText" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"
value="${requestScope.page}"/>
<input type="submit" onclick="toPage()" value="GO"/>
</td>
</tr>
</table>
</c:if>
</form>
</center>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -