⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adminpage.jsp

📁 简单的流言板系统,用myeclipse进行编写的,采用简单的jstl+javabean+servlet+jsp,属于三层架构.
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@include file="./tags.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<style type="text/css">
<!--
.STYLE2 {font-family: "Courier New", Courier, monospace}
-->
</style>
<script type="text/javascript" language="javascript">
function formSubmit(method,msgid){
 document.forms[0].action = '${pageContext.request.contextPath}/AdminMM?method=' + method + '&id=' + msgid ;
return true;
}
</script>
<body>
<form action="" method="post">
<c:if test="${meth == 'all'}">
<c:if test="${info != null}">
<table border="0" align="center">
	<tr>
		<td style="color: red;">
			<c:out value="${info }" />
		</td>
	</tr>
</table>
</c:if>
<!-- show all the messages -->
<table width="733" height="62" border="1" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <th width="114" height="24" scope="col"><span class="STYLE2">Name</span></th>
    <th width="301" scope="col"><span class="STYLE2">Title</span></th>
    <th width="186" scope="col"><span class="STYLE2">Date</span></th>
    <th width="122" scope="col"><span class="STYLE2">Replies</span></th>
    <th width="122" scope="col"><span class="STYLE2">Operation</span></th>
  </tr>
  <c:forEach var="msg" items="${msgList}">
  <tr>
    <td height="36">${msg.userName }</td>
    <td>${msg.msgTitle }</td>
    <td>${msg.msgDate }</td>
    <td>${msg.msgReplies }</td>
    <td><label>
      <input type="submit" name="Submit" value="delete" onclick="formSubmit('delete','${msg.msgID }')"/>
      <input type="submit" name="Submit2" value="reply" onclick="formSubmit('reply','${msg.msgID }')"/>
    </label></td>
  </tr>
  </c:forEach>
  <tr>
    <td height="30" colspan="5"><label><a href="${pageContext.request.contextPath }/AdminServlet?b=${b}&method=all">Preview</a></label>
      &nbsp;&nbsp;&nbsp;<a href="${pageContext.request.contextPath }/AdminServlet?e=${e}&method=all">Next</a>&nbsp;&nbsp;&nbsp;<label> All : ${pages } pages / Current page:${c }</label> </td>
  </tr>
</table>
</c:if>
<c:if test="${meth == 'un'}">
<!-- show messages that are not repled -->
<c:if test="${info != null}">
<table border="0" align="center">
	<tr>
		<td style="color: red;">
			<c:out value="${info }" />
		</td>
	</tr>
</table>
</c:if>
<!-- show the messages -->
<table width="733" height="62" border="1" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <th width="114" height="24" scope="col"><span class="STYLE2">Name</span></th>
    <th width="301" scope="col"><span class="STYLE2">Title</span></th>
    <th width="186" scope="col"><span class="STYLE2">Date</span></th>
    <th width="122" scope="col"><span class="STYLE2">Replies</span></th>
    <th width="122" scope="col"><span class="STYLE2">Operation</span></th>
  </tr>
  <c:forEach var="msg" items="${msgList}">
  <tr>
    <td height="36">${msg.userName }</td>
    <td>${msg.msgTitle }</td>
    <td>${msg.msgDate }</td>
    <td>${msg.msgReplies }</td>
    <td><label>
      <input type="submit" name="Submit" value="delete" onclick="formSubmit('delete','${msg.msgID }')"/>
      <input type="submit" name="Submit2" value="reply" onclick="formSubmit('reply','${msg.msgID }')"/>
    </label></td>
  </tr>
  </c:forEach>
  <tr>
    <td height="30" colspan="5"><label><a href="${pageContext.request.contextPath }/AdminServlet?b=${b}&method=un">Preview</a></label>
      &nbsp;&nbsp;&nbsp;<a href="${pageContext.request.contextPath }/AdminServlet?e=${e}&method=un">Next</a>&nbsp;&nbsp;&nbsp;<label> All : ${pages } pages/  Current page:${c }</label> </td>
  </tr>
</table>
</c:if>
<c:if test="${meth == 'user'}">
<c:if test="${info != null}">
<table border="0" align="center">
	<tr>
		<td style="color: red;">
			<c:out value="${info }" />
		</td>
	</tr>
</table>
</c:if>
<!-- show all users-->
<table width="733" height="62" border="1" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <th width="114" height="24" scope="col"><span class="STYLE2">userID</span></th>
    <th width="301" scope="col"><span class="STYLE2">user name</span></th>
    <th width="186" scope="col"><span class="STYLE2">user email</span></th>
     <th width="122" scope="col"><span class="STYLE2">Operation</span></th>
  </tr>
  <c:forEach var="user" items="${userList}">
  <tr>
    <td height="36">${user.userID }</td>
    <td>${user.userName }</td>
    <td>${user.userEmail }</td>   
    <td><label>
      <input type="submit" name="Submit" value="delete" onclick="formSubmit('deleteu','${user.userID }')"/>      
    </label></td>
  </tr>
  </c:forEach>
  <tr>
    <td height="30" colspan="5"><label><a href="${pageContext.request.contextPath }/AdminServlet?b=${b}&method=user">Preview</a></label>
      &nbsp;&nbsp;&nbsp;<a href="${pageContext.request.contextPath }/AdminServlet?e=${e}&method=user">Next</a>&nbsp;&nbsp;&nbsp;<label> All : ${pages } pages/  Current page:${c }</label> </td>
  </tr>
</table>
</c:if>
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -