?? update_do.jsp
字號:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="cn.mldn.lxh.note.factory.*"%>
<html>
<head>
<title>JSP+DAO 留言管理程序——登陸</title>
</head>
<body>
<center>
<h1>留言管理范例 —— JSP + DAO實現(xiàn)</h1>
<hr>
<br>
<%
// 進行亂碼處理
request.setCharacterEncoding("GB2312") ;
%>
<jsp:useBean id="note" scope="page" class="cn.mldn.lxh.note.vo.Note"/>
<jsp:setProperty name="note" property="*"/>
<%
if(session.getAttribute("uname")!=null)
{
// 用戶已登陸
%>
<%
response.setHeader("refresh","2;URL=list_notes.jsp") ;
try
{
DAOFactory.getNoteDAOInstance().update(note) ;
%>
留言修改成功,兩秒后跳轉(zhuǎn)到留言列表頁!!!<br>
如果沒有跳轉(zhuǎn),請按<a href="list_notes.jsp">這里</a>!!!
<%
}
catch(Exception e)
{
%>
留言修改失敗,兩秒后跳轉(zhuǎn)到留言列表頁!!!<br>
如果沒有跳轉(zhuǎn),請按<a href="list_notes.jsp">這里</a>!!!
<%
}
%>
<%
}
else
{
// 用戶未登陸,提示用戶登陸,并跳轉(zhuǎn)
response.setHeader("refresh","2;URL=login.jsp") ;
%>
您還未登陸,請先登陸!!!<br>
兩秒后自動跳轉(zhuǎn)到登陸窗口!!!<br>
如果沒有跳轉(zhuǎn),請按<a href="login.jsp">這里</a>!!!<br>
<%
}
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -