⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 boardmanager_jsp.java

📁 论坛源码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
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("<!--¿ªÊ¼µ¼Èë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 + -