?? update.jsp
字號:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="cn.mldn.lxh.note.vo.*"%>
<html>
<head>
<title>MVC+DAO 留言管理程序——登陸</title>
</head>
<body>
<center>
<h1>留言管理范例 —— MVC + DAO實現</h1>
<hr>
<br>
<%
// 進行亂碼處理
request.setCharacterEncoding("GB2312") ;
%>
<%
if(session.getAttribute("uname")!=null)
{
// 用戶已登陸
%>
<%
Note note = (Note)request.getAttribute("note") ;
%>
<%
if(note!=null)
{
int id = note.getId() ;
String title = note.getTitle() ;
String author = note.getAuthor() ;
String content = note.getContent() ;
%>
<form action="Note" method="post">
<table>
<tr>
<td colspan="2">編輯留言</td>
</tr>
<tr>
<td>標題:</td>
<td><input type="text" name="title" value="<%=title%>"></td>
</tr>
<tr>
<td>作者:</td>
<td><input type="text" name="author" value="<%=author%>"></td>
</tr>
<tr>
<td>內容:</td>
<td><textarea name="content" cols="30" rows="6"><%=content%></textarea></td>
</tr>
<tr>
<td colspan="2">
<input type="hidden" name="id" value="<%=id%>">
<input type="hidden" name="status" value="update">
<input type="submit" value="更新">
<input type="reset" value="重置">
</td>
</tr>
</table>
</form>
<%
}
else
{
%>
沒有發現,要更新的內容!!<br>
請確認要更新的留言是否存在!!<br>
<%
}
%>
<h3><a href="Note?status=selectall">回到留言列表頁</a></h3>
<%
}
else
{
// 用戶未登陸,提示用戶登陸,并跳轉
response.setHeader("refresh","2;URL=login.jsp") ;
%>
您還未登陸,請先登陸!!!<br>
兩秒后自動跳轉到登陸窗口!!!<br>
如果沒有跳轉,請按<a href="login.jsp">這里</a>!!!<br>
<%
}
%>
</center>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -