📄 addmessege.jsp
字号:
<%@page contentType="text/html; charset=gb2312" errorPage=""%>
<%@page import="java.sql.*,sms.db.*,sms.bean.*,java.util.*"%>
<%!
private String isSelected(String value1, String value2) {
if (value1 != null && value2 != null && value1.equals(value2))
return "selected";
else
return "";
}
%>
<%
request.setCharacterEncoding("gb2312");
String topic = "";
String author = "";
String column = "";
String content = "";
String commitFlag = request.getParameter("addButton");
System.out.println("test in addMessege.jsp commitFlag:"+commitFlag);
if(commitFlag != null){
topic = request.getParameter("topic");
author = request.getParameter("author");
column = request.getParameter("column");
content = request.getParameter("content");
DBAccess dba = new DBAccess();
String sql = "insert into messege_info (topic,author,content,column_id,add_time) values('"+topic+"','"+author+"','"+content+"','"+column+"',sysdate())";
dba.getConnection();
int flag = dba.executeSql(sql);
dba.closeConnection();
if(flag > 0){
%>
<script language="javascript" type="">
alert('添加成功!');
</script>
<%
}else{
%>
<script language="javascript" type="">
alert('添加失败!');
</script>
<%
}
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添加留言板信息</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
background-color: #CCCCCC;
}
-->
</style></head>
<body>
<table width="100%" border="0">
<tr>
<td height="33">添加留言板信息</td>
</tr>
<tr>
<td height="367" align="center" valign="top">
<form name="form1" method="post" action="addMessege.jsp">
<table width="100%" border="1" bordercolorlight= #C1A4F4 borderColorDark=#ffffff cellPadding=0 cellSpacing=0 >
<tr>
<td width="13%" height="37" align="right">标题:</td>
<td width="87%" height="37" align="left"><input name="topic" type="text" class="text1" value="<%=topic%>"></td>
</tr>
<tr>
<td height="34" align="right">作者:</td>
<td align="left"><input name="author" type="text" class="text1" value="<%=author%>"></td>
</tr>
<tr>
<td height="30" align="right">栏目类型:</td>
<td align="left">
<select name="column" class="select1">
<option id="1" value="1" <%=isSelected("1",column)%>>校办专栏</option>
<option id="2" value="2" <%=isSelected("2",column)%>>后勤管理专栏</option>
<option id="3" value="3" <%=isSelected("3",column)%>>教务处专栏</option>
<option id="4" value="4" <%=isSelected("4",column)%>>计算机中心专栏</option>
<option id="5" value="5" <%=isSelected("5",column)%>>招生就业专栏</option>
<option id="6" value="6" <%=isSelected("6",column)%>>其他专栏</option>
</select></td>
</tr>
<tr>
<td height="170" align="right" valign="top">内容:</td>
<td align="left"><textarea name="content" class="textarea" cols="20" rows="10"> <%=content%></textarea></td>
</tr>
<tr>
<td height="41" align="right"> </td>
<td align="left"><input name="addButton" type="submit" class="button1" value="添加"></td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -