?? guestbook_005fmanage_jsp.java
字號:
package org.apache.jsp.work.admin.guestBook;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import com.deepteach.guestBook.*;
import java.util.ArrayList;
public final class GuestBook_005fManage_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List _jspx_dependants;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.AnnotationProcessor _jsp_annotationprocessor;
public Object getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
}
public void _jspDestroy() {
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=GBK");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write('\r');
out.write('\n');
/*
* ┌──────────────────── 深度學習 ──┐
* │程序名稱:留言板后臺管理
* │軟件類別:功能模塊
* │授權(quán)方式:
* │作 用:用于網(wǎng)站一般留言
* │說 明:
* │日 期:2007/8/10
* │編寫人:呂海鵬
* └──────────────────── www.deepteach.com ──┘
*/
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
//-----------------定義留言板常用信息 開始 -----------------
String meta_keywords="deepteach.com,";
String meta_description="deepteach.com";
String head_title="deepteach.com,";
String siteName="深度學習(jsp)留言板";
String siteCopyRight="版權(quán)所有 deepteach.com";
int GuestBook_user_id = 0 ; //GuestBook_user_id網(wǎng)站變量定義留言板用戶 默認0
//-----------------定義留言板常用信息 結(jié)束 -----------------
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n");
out.write("<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n");
out.write("<head>\r\n");
out.write("\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=GBK\" />\r\n");
out.write("\t<meta name=\"keywords\" content=\"");
out.print(meta_keywords);
out.write("\" />\r\n");
out.write("\t<meta name=\"description\" content=\"");
out.print(meta_description);
out.write("\" />\r\n");
out.write("\r\n");
out.write("\t<title>【");
out.print(siteName);
out.write("后臺管理】");
out.print(head_title);
out.write("</title>\r\n");
out.write("\t<link href=\"../styles/style_GuestBook.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n");
out.write("</head>\r\n");
out.write("\r\n");
out.write("<body>\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\t<br />\t<br />\r\n");
out.write("\r\n");
out.write(" <h3>");
out.print(siteName);
out.write("</h3>\r\n");
out.write(" <hr width=\"90%\"/>\r\n");
out.write("\t<br />\r\n");
out.write("\r\n");
out.write("<!-------留言板 開始--------------> \r\n");
String action="noAction";
if(request.getParameter("action")!=null)
{action=request.getParameter("action");}
if ( action.equals("add") )
{
out.write("\r\n");
out.write("\t<script language=\"javascript\">\r\n");
out.write("\t\tfunction check_form() {\r\n");
out.write("\t\t\tif (document.form1.username.value==\"\")\t{\r\n");
out.write("\t\t\t\twindow.alert(\"請輸入姓名!!!\");\r\n");
out.write("\t\t\t\tdocument.form1.username.focus();\r\n");
out.write("\t\t\t\treturn false;\r\n");
out.write("\t\t\t}\r\n");
out.write("\t\t\tif (document.form1.tel.value==\"\")\t{\r\n");
out.write("\t\t\t\twindow.alert(\"請輸入電話!!!\");\r\n");
out.write("\t\t\t\tdocument.form1.tel.focus();\r\n");
out.write("\t\t\t\treturn false;\r\n");
out.write("\t\t\t}\r\n");
out.write("\t\t\tif (document.form1.email.value==\"\")\t{\r\n");
out.write("\t\t\t\twindow.alert(\"請輸入E-mail!!!\");\r\n");
out.write("\t\t\t\tdocument.form1.email.focus();\r\n");
out.write("\t\t\t\treturn false;\r\n");
out.write("\t\t\t}\r\n");
out.write("\t\t\tif (document.form1.content.value==\"\")\t{\r\n");
out.write("\t\t\t\twindow.alert(\"請輸入留言內(nèi)容!!!\");\r\n");
out.write("\t\t\t\tdocument.form1.content.focus();\r\n");
out.write("\t\t\t\treturn false;\r\n");
out.write("\t\t\t}\r\n");
out.write("\t\t}\r\n");
out.write("\t</script>\r\n");
out.write("\t\r\n");
out.write("\t<form id=\"form1\" name=\"form1\" method=\"post\" action=\"?action=save&GuestType=");
out.print(request.getParameter("GuestType"));
out.write("\" onSubmit=\"return check_form()\">\r\n");
out.write("\t <table width=\"95%\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"class=\"table_td_guest\">\r\n");
out.write("\t\t<tr>\r\n");
out.write("\t\t <td colspan=\"2\" height=\"25\"> 書寫留言(*為必填項)</td>\r\n");
out.write("\t\t</tr>\r\n");
out.write("\t\t<tr>\r\n");
out.write("\t\t <td align=\"center\">姓名: </td>\r\n");
out.write("\t\t <td><input maxlength=\"20\" size=\"14\" name=\"username\" />\r\n");
out.write("\t\t\t*\r\n");
out.write("\t\t\t");
if(request.getParameter("GuestType").equals("0")){
out.write("\r\n");
out.write("\t\t\t<input type=\"radio\" checked=\"checked\" value=\"GuestBook_boy.gif\" name=\"sex\" />\r\n");
out.write("\t\t\t先生\r\n");
out.write("\t\t\t<input type=\"radio\" value=\"GuestBook_girl.gif\" name=\"sex\" />\r\n");
out.write("\t\t\t女士 </td>\r\n");
out.write("\t\t\t");
}
out.write("\r\n");
out.write("\t\t</tr>\r\n");
out.write("\t\t");
if(request.getParameter("GuestType").equals("0")){
out.write("\r\n");
out.write("\t\t<tr>\r\n");
out.write("\t\t <td align=\"center\">來自: </td>\r\n");
out.write("\t\t <td><input maxlength=\"20\" size=\"14\" name=\"from\" />\r\n");
out.write("\t\t\t電話:\r\n");
out.write("\t\t\t<input maxlength=\"40\" size=\"25\" name=\"tel\" />\r\n");
out.write("\t\t\t* </td>\r\n");
out.write("\t\t</tr>\r\n");
out.write("\t\t<tr>\r\n");
out.write("\t\t <td align=\"center\">電郵: </td>\r\n");
out.write("\t\t <td><input maxlength=\"100\" size=\"50\" name=\"email\" />\r\n");
out.write("\t\t\t* </td>\r\n");
out.write("\t\t</tr>\r\n");
out.write("\t\t<tr>\r\n");
out.write("\t\t <td align=\"center\">QQ: </td>\r\n");
out.write("\t\t <td><input maxlength=\"20\" size=\"50\" name=\"QQ\" />\r\n");
out.write("\t\t </td>\r\n");
out.write("\t\t</tr>\r\n");
out.write("\t\t");
}
out.write("\r\n");
out.write("\t\t<tr>\r\n");
out.write("\t\t <td align=\"center\">留言: </td>\r\n");
out.write("\t\t <td><textarea name=\"content\" rows=\"7\" cols=\"55\"></textarea>\r\n");
out.write("\t\t\t* </td>\r\n");
out.write("\t\t</tr>\r\n");
out.write("\t\t<tr>\r\n");
out.write("\t\t <td valign=\"top\" align=\"center\" colspan=\"2\">\r\n");
out.write("\t\t\t");
if(request.getParameter("GuestType").equals("0")){
out.write("\r\n");
out.write("\t\t \t\t<input type=\"submit\" value=\"留 言\" name=\"submit\" />\r\n");
out.write("\t\t \t");
}else{
out.write("\r\n");
out.write("\t\t \t\t<input type=\"submit\" value=\"回 復(fù)\" name=\"submit\" />\r\n");
out.write("\t\t \t");
}
out.write("\r\n");
out.write("\t\t\t <input onClick=\"javascript:return confirm('此操作將清空您填寫的內(nèi)容,\\n您確定嗎?');\" type=\"reset\" value=\"重 寫\" name=\"reset\" />\r\n");
out.write("\t\t\t <input onClick=\"javascript:history.back();\" type=\"button\" value=\"返 回\" name=\"return\" />\r\n");
out.write("\t\t </td>\r\n");
out.write("\t\t</tr>\r\n");
out.write("\t </table>\r\n");
out.write("\t</form>\r\n");
}
if (action.equals("save"))
{
String GuestName=new String(request.getParameter("username").getBytes("iso-8859-1"));
String GuestFace="";
String GuestFrom="";
String GuestTel="";
String GuestEmail="";
String GuestQQ="";
if( request.getParameter("GuestType").equals("0") ){
GuestFace=request.getParameter("sex");
GuestFrom=new String(request.getParameter("from").getBytes("iso-8859-1"));
GuestTel=new String(request.getParameter("tel").getBytes("iso-8859-1"));
GuestEmail=new String(request.getParameter("email").getBytes("iso-8859-1"));
GuestQQ=new String(request.getParameter("QQ").getBytes("iso-8859-1"));
}
String GuestContent=new String(request.getParameter("content").getBytes("iso-8859-1"));
int GuestType=Integer.parseInt(request.getParameter("GuestType"));
GuestBook gb=new GuestBook();
gb.setGuestName( GuestName );
gb.setGuestFace(GuestFace);
gb.setGuestFrom(GuestFrom);
gb.setGuestTel( GuestTel );
gb.setGuestEmail(GuestEmail);
gb.setGuestQQ(GuestQQ);
gb.setGuestContent( GuestContent );
gb.setGuestType(GuestType);
gb.setGuestIsPassed(1);
gb.setUser_id(GuestBook_user_id);//GuestBook_user_id網(wǎng)站變量定義留言板用戶 默認0
gb.add();
out.println("留言提交成功!!!<br />");
//out.println("此信息將由管理員審核,審核期間不會顯示,謝謝!!!<br />");
out.println("<a href='GuestBook_Manage.jsp'>返回</a><br />");
}
if (action.equals("del")){
int id=Integer.parseInt(request.getParameter("id"));
GuestBook gb_del=new GuestBook();
int del_success;
del_success=gb_del.delete(id);
if (del_success>0){
out.print("留言刪除成功!!!<br />");
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -