📄 update.jsp
字号:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="login1.*"%>
<%@ page import="note1.*"%>
<html>
<head>
<title>JSP+DAO 留言管理程序——更新</title>
</head>
<body>
<center>
<h1>留言管理范例 —— JSP + DAO实现</h1>
<hr>
<br>
<%
int id=0;
note note=null;
id=Integer.parseInt(request.getParameter("id"));
try
{
note=personFactory.getnoteDAoinstance().findbyname(id);
}
catch(Exception e)
{}
if(note!=null)
{
id=note.getid();
String title=note.gettitle();
String content=note.getcontent();
String author=note.getauthor();
%>
<form action="update_do.jsp" 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><input type="text" name="content" value=<%=content%>></td>
</tr>
<tr>
<input type="hidden" name="id" value="<%=id%>">
<td colspan="2"><input type="submit" value="更新"><input type="submit" value="重置"></td>
</tr>
<%
}else
{
%>
没有发现,要更新的内容!!<br>
请确认要更新的留言是否存在!!<br>
<a href="list.jsp">回到留言列表页</a>
<%
}
%>
</center>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -