?? boardmanager_jsp.java
字號:
package org.apache.jsp.web.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.io.*;
import java.util.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public final class boardmanager_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
public String getServletInfo() {
return "database handler";
}
private static java.util.Vector _jspx_dependants;
static {
_jspx_dependants = new java.util.Vector(1);
_jspx_dependants.add("/web/jsp/incdb.jsp");
}
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
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 {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html;charset=gb2312");
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\n");
out.write("\r\n");
out.write("<!--?aê?μ?è?packages-->\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!--μ?è??áê?-->");
out.write('\r');
out.write('\n');
twm.bbsboard board = null;
synchronized (_jspx_page_context) {
board = (twm.bbsboard) _jspx_page_context.getAttribute("board", PageContext.PAGE_SCOPE);
if (board == null){
board = new twm.bbsboard();
_jspx_page_context.setAttribute("board", board, PageContext.PAGE_SCOPE);
}
}
out.write('\r');
out.write('\n');
String tempSTR,whereTo;
//byte[] tmpbyte;
int method;
String strSQL;
java.sql.ResultSet sqlRst;
int boardid,boardhits,boardtopics;
String boardname,boardmaster,masterpwd,masteremail,masterword;
tempSTR=(String)session.getValue("adminlogin");
if (tempSTR!="true") {
out.write('\r');
out.write('\n');
if (true) {
_jspx_page_context.forward("adminlog.jsp");
return;
}
out.write('\r');
out.write('\n');
}
tempSTR=null;
tempSTR=request.getParameter("method");
if (tempSTR==null){
method=0;
}
else
{
method=java.lang.Integer.parseInt(tempSTR);
}
//'
//'method=4 顯示增加論壇表格
//'method=5 顯示修改刪除論壇表格
//'method=6 退出論壇管理
//'
//'method=1 為增加論壇
//'method=2 為修改論壇
//'method=3 為刪除論壇
out.write('\r');
out.write('\n');
if (method==6) {
//'method=6 退出論壇管理
session.putValue("adminlogin","false");
out.write('\r');
out.write('\n');
if (true) {
_jspx_page_context.forward("adminlog.jsp");
return;
}
out.write('\r');
out.write('\n');
} //'end if method==6;
out.write('\r');
out.write('\n');
if (method==1) {
//'method=1 為增加論壇
boardname=request.getParameter("boardname");
boardmaster=request.getParameter("boardmaster");
masterpwd=request.getParameter("masterpwd");
masteremail=request.getParameter("masteremail");
masterword=request.getParameter("masterword");
//boardname=boardname.trim();
//boardmaster=boardmaster.trim();
//masterpwd=masterpwd.trim();
//masteremail=masteremail.trim();
//tmpbyte=boardname.getBytes("ISO8859_1");
//boardname=new String(tmpbyte);
//tmpbyte=boardmaster.getBytes("ISO8859_1");
//boardmaster=new String(tmpbyte);
//tmpbyte=masterword.getBytes("ISO8859_1");
//masterword=new String(tmpbyte);
boardhits=0;
boardtopics=0;
if (!board.checkBoardName(boardname)) {
//'重名
out.write('\r');
out.write('\n');
whereTo="boardmanager.jsp?method=4";
out.write('\r');
out.write('\n');
if (true) {
_jspx_page_context.forward(whereTo);
return;
}
out.write('\r');
out.write('\n');
}else { //'end if
board.setBoardName(boardname);
board.setBoardMaster(boardmaster);
board.setBoardMasterpwd(masterpwd);
board.setBoardMasterword(masterword);
board.setBoardMasteremail(masteremail);
board.setBoardHits(boardhits);
board.setBoardTopics(boardtopics);
board.newBoard();
out.write('\r');
out.write('\n');
if (true) {
_jspx_page_context.forward("boardmanager.jsp?method=0");
return;
}
out.write('\r');
out.write('\n');
}// end else
} //'End if (method==1) {
if (method==2) {
//'method=2 為修改論壇
tempSTR=request.getParameter("boardid");
boardid=java.lang.Integer.parseInt(tempSTR);
boardmaster=request.getParameter("boardmaster");
masterpwd=request.getParameter("masterpwd");
masteremail=request.getParameter("masteremail");
masterword=request.getParameter("masterword");
boardhits=0;
boardtopics=0;
//boardname=boardname.trim();
//boardmaster=boardmaster.trim();
//masterpwd=masterpwd.trim();
//masteremail=masteremail.trim();
//tmpbyte=boardname.getBytes("ISO8859_1");
//boardname=new String(tmpbyte);
//tmpbyte=boardmaster.getBytes("ISO8859_1");
//boardmaster=new String(tmpbyte);
//tmpbyte=masterword.getBytes("ISO8859_1");
//masterword=new String(tmpbyte);
board.setBoardMaster(boardmaster);
board.setBoardMasterpwd(masterpwd);
board.setBoardMasterword(masterword);
board.setBoardMasteremail(masteremail);
board.updateBoard(boardid);
out.write('\r');
out.write('\n');
if (true) {
_jspx_page_context.forward("boardmanager.jsp?method=0");
return;
}
out.write('\r');
out.write('\n');
} //'End if method==2
out.write("\r\n");
out.write("\r\n");
if (method==3) {
//'method=3 為刪除論壇
tempSTR=request.getParameter("boardid");
boardid=java.lang.Integer.parseInt(tempSTR);
board.delBoard(boardid);
out.write('\r');
out.write('\n');
if (true) {
_jspx_page_context.forward("boardmanager.jsp?method=0");
return;
}
out.write('\r');
out.write('\n');
} //'End if METHOD==3
out.write(" \r\n");
out.write("\r\n");
out.write("<html>\r\n");
out.write("\r\n");
out.write("<head>\r\n");
out.write("\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
out.write("\r\n");
out.write("<title>New Page 1</title>\r\n");
out.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"bbs03.css\">\r\n");
out.write("<script Language=\"JavaScript\">\r\n");
out.write("<!--\r\n");
out.write("function isspacestring(mystring)\r\n");
out.write("//是否為空格字符串;true為空,FALSE為非空\r\n");
out.write("{ var istring=mystring;\r\n");
out.write(" var temp,i,strlen;\r\n");
out.write(" temp=true;\r\n");
out.write(" strlen=istring.length;\r\n");
out.write(" for (i=0;i<strlen;i++)\r\n");
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -