📄 modify.jsp
字号:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="com.wxpn.tutorial.servlet.BBSMsg"%>
<%@ page import="com.wxpn.tutorial.servlet.Encoder"%>
<%if (session.getAttribute("userName") == null) {
response.sendRedirect("login.jsp");
}%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>BBS-修改</title>
<script language="JavaScript"><!--
function validateCompose(){
var MB_TITLE = document.frmCompose.MB_TITLE.value;
var MB_CONTENT = document.frmCompose.MB_CONTENT.value;
if (MB_TITLE ==""){
alert("必须填写标题!");
return false;
}
if (MB_CONTENT ==""){
alert("必须填写内容!");
return false;
}
}
-->
</script>
</head>
<body>
<div align=center>
<form name="frmCompose" method="POST" action="ModifyServlet"
onSubmit="javaScript:return validateCompose();">
<table border="0" width=600 bgcolor="#efefef" cellspacing="0"
cellpadding="0">
<%if (request.getAttribute("msg") == null) {%>
<tr>
<td width="100%" align=center colspan="2" height="30"
bgcolor="#0000FF"><font color="#FFFFFF"><b>不存在该留言!</b></font></td>
</tr>
<%} else {
BBSMsg msg = (BBSMsg) request.getAttribute("msg");
%>
<tr>
<td width="100%" align=center colspan="2" height="30"
bgcolor="#0000FF"><font color="#FFFFFF"><b>修改留言</b></font></td>
</tr>
<tr>
<td width="20%" bgcolor="#FCFCFC" align=right>标题: </td>
<td width="80%" bgcolor="#FCFCFC">
<input type="text" name="MB_TITLE" size="35" value="<%=msg.getItem_title() %>"></td>
</tr>
<tr>
<td width="20%" bgcolor="#FCFCFC" align=right valign="top">内容: </td>
<td width="80%" bgcolor="#FCFCFC"><textarea rows="8" name="MB_CONTENT"
cols="34"><%=Encoder.returnBackToBr(msg.getItem_content())%></textarea></td>
</tr>
<tr>
<td width="20%" bgcolor="#FCFCFC" align=right valign="top">表情: </td>
<td width="80%" bgcolor="#FCFCFC"><%for (int i = 1; i <= 40; i++) {
%>
<INPUT type="radio" value="<%=i %>" name="face" <%if(i==msg.getFace()){ %>checked="checked"<%} %>><img src="/BBS/image/<%=i %>.gif"> <%if (i % 8 == 0) {
out.println("<br>");
}
}
%></td>
</tr>
<tr>
<td width="20%" bgcolor="#FCFCFC" align=right>撰写人: </td>
<td width="80%" bgcolor="#FCFCFC"><font color=#FF0000><%=session.getAttribute("userName")%></font>
</td>
</tr>
<tr>
<td width="100%" align=center colspan="2" height="50"><input
type="hidden" name="id" value="<%=msg.getItem_id() %>"> <input type="submit"
value="提交" name="submit"> <input type="reset" value="重置"
name="reset"></td>
</tr>
<%}
%>
</table>
</form>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -