【JSP开源代码栏目提醒】:网学会员为需要JSP开源代码的朋友们搜集整理了admin_browse.jsp相关资料,希望对各位网友有所帮助!
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="GB2312"%>
<%@ page import="java.util.Collection,java.util.Iterator"%>
<%@ page import="com.wxpn.tutorial.servlet.News"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>浏览</title>
<script language="JavaScript"><!--
function check(id){
if (confirm("确定删除"+id+"吗?")){
location.href="DeleteNewsServlet?id="+id;
}
}
-->
</script>
</head>
<body>
<center>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="75%" bgcolor="#0000FF" height="35" align=center><b><font
color="#FFFFFF">浏览新闻 </font></b></td>
</tr>
</table>
<table border="1" width="100%" bordercolorlight="#C0C0C0"
bordercolordark="#FFFFFF" cellspacing="0" cellpadding="0">
<tr>
<td width="10%" bgcolor="#FCFCFC">编号</td>
<td width="40%" bgcolor="#FCFCFC">题目</td>
<td width="15%" bgcolor="#FCFCFC">发布日期</td>
<td width="15%" bgcolor="#FCFCFC">发布人</td>
<td width="15%" bgcolor="#FCFCFC"> </td>
</tr>
<%if (request.getAttribute("c") == null) {
%>
<tr>
<td width="" 75%"" colspan=5 bgcolor="#FCFCFC" align=center>还没有任何新闻。</td>
</tr>
<%} else {
Collection c = (Collection) request.getAttribute("c");
if (c == null) {
%>
<tr>
<td width="" 75%"" colspan=5 bgcolor="#FCFCFC" align=center>还没有任何新闻。</td>
</tr>
<%} else {
int currentPage = 1;
if (request.getParameter("page") != null) {
currentPage = Integer.parseInt(request
.getParameter("page"));
}
Iterator iterator = c.iterator();
while (iterator.hasNext()) {
News msg = (News) iterator.next();
%>
<tr>
<td width="10%" bgcolor="#FCFCFC"><a
href="ReadServlet?id=<%=msg.getId()%>&url=read.jsp"><%=msg.getId()%></a></td>
<td width="40%" bgcolor="#FCFCFC"><%=msg.getTitle()%></td>
<td width="15%" bgcolor="#FCFCFC"><%=msg.getStrCompose_date()%></td>
<td width="15%" bgcolor="#FCFCFC"><%=msg.getAuthor()%></td>
<td width="15%" bgcolor="#FCFCFC"><a href="#"
onclick="javascript:check('<%=msg.getId()%>');">删除</a>|<a href="ReadServlet?id=<%=msg.getId()%>&url=edit.jsp">修改</a></td>
</tr>
<%}%>
<tr>
<td width="75%" colspan=5 align=right height="50" bgcolor="#EFEFEF">
<a href="BrowseServlet">[更多新闻]</a> </td>
</tr>
<%}
}
%>
<tr>
<td width="75%" colspan=5 align=center height="50" bgcolor="#EFEFEF">
<%//如果用户已经登录,则允许发布留言:
if (session.getAttribute("userName") != null) {%> [<a
href="compose.jsp">发布新闻</a>] <%} else {
%>[<a href="login.jsp">登录</a>] <%}%>
</tr>
</table>
</center>
</body>
</html>
上一篇:
admin_boardaset.jsp
下一篇:
网络能耗监测系统管理端的研究与实现