📄 superlog_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 superlog_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("\r\n");
request.setCharacterEncoding("GB2312");
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.bbsreg reg = null;
synchronized (_jspx_page_context) {
reg = (twm.bbsreg) _jspx_page_context.getAttribute("reg", PageContext.PAGE_SCOPE);
if (reg == null){
reg = new twm.bbsreg();
_jspx_page_context.setAttribute("reg", reg, PageContext.PAGE_SCOPE);
}
}
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 B1=request.getParameter("B1");
boolean yesorno;
String strSQL,whereTo,tempSTR;
java.sql.ResultSet sqlRst;
String tt,sel,boardname,boardmaster,masterpwd;
int i,boardid;
tt=request.getParameter("tt");
if (tt==null) {
tt="";
}
out.write('\r');
out.write('\n');
if (B1!=null){
session.putValue("superlogin","false");
boardmaster=request.getParameter("boardmaster");
masterpwd=request.getParameter("masterpwd");
tempSTR=request.getParameter("boardid");
boardid=java.lang.Integer.parseInt(tempSTR);
whereTo="";
if ((boardmaster==null)||(masterpwd==null)) {
tt="username or password is empty,please login again!" ;
whereTo="superlog.jsp?tt="+tt;
}else{
if (board.checkBoardMaster(boardid,boardmaster,masterpwd)){ //'正确登录
session.putValue("superlogin","true");
whereTo="bbslist.jsp?method=8&boardid="+boardid;
}else {
tt="username or password is wrong!!!";
whereTo="superlog.jsp?tt="+tt;
}
}//end if boardmast=null masterpwd==null
out.write("\r\n");
out.write("<script language=\"JavaScript\">\r\n");
out.write(" window.location=\"");
out.print(whereTo);
out.write("\";\r\n");
out.write("</script> \r\n");
out.write("\r\n");
} //'END IF b1
out.write("\r\n");
out.write("\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
out.write("\r\n");
out.write("<title>论坛管理</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");
out.write(" {\r\n");
out.write(" if ((istring.substring(i,i+1)!=\" \")&(temp))\r\n");
out.write(" { temp=false; }\r\n");
out.write(" }\r\n");
out.write(" return temp;\r\n");
out.write("}\r\n");
out.write("\r\n");
out.write("function check_input(theForm)\r\n");
out.write("{\r\n");
out.write("\r\n");
out.write(" if ((theForm.boardmaster.value == \"\")|(isspacestring(theForm.boardmaster.value)))\r\n");
out.write(" {\r\n");
out.write(" alert(\"请输入用户名.\");\r\n");
out.write(" theForm.boardmaster.focus();\r\n");
out.write(" return (false);\r\n");
out.write(" }\r\n");
out.write(" \r\n");
out.write(" if ((theForm.masterpwd.value == \"\")|(isspacestring(theForm.masterpwd.value)))\r\n");
out.write("\r\n");
out.write(" {\r\n");
out.write(" alert(\"请输入密码.\");\r\n");
out.write(" theForm.masterpwd.focus();\r\n");
out.write(" return (false);\r\n");
out.write(" }\r\n");
out.write("\r\n");
out.write(" return (true);\r\n");
out.write("}\r\n");
out.write("-->\r\n");
out.write("</script>\r\n");
out.write("\r\n");
out.write("</head>\r\n");
out.write("\r\n");
out.write("<body>\r\n");
if (B1==null){
out.write("\r\n");
out.write("<!--------------------------------------------------------------->\r\n");
out.write("<div align=\"center\">\r\n");
out.write(" <center>\r\n");
out.write("<table border=\"1\" width=\"400\" bordercolorlight=\"#FFFFFF\" bordercolordark=\"#000000\" cellspacing=\"0\" cellpadding=\"0\">\r\n");
out.write(" <tr>\r\n");
out.write(" <td width=\"100%\" bgcolor=\"#EFFFCE\">\r\n");
out.write(" <p align=\"center\"><font color=\"#99CC66\">板主登录</font></p></td>\r\n");
out.write(" \r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td width=\"100%\">\r\n");
out.write(" <form method=\"POST\" action=\"superlog.jsp\" onSubmit=\"return check_input(this)\" name=\"form1\">");
out.print(tt);
out.write("\r\n");
out.write(" <p align=\"center\">\r\n");
out.write(" <select size=\"1\" name=\"boardid\"> \r\n");
sqlRst=board.listBoard(1);
i=1;
while (sqlRst.next()) {
if (i==1) {
sel="selected";
}else{
sel="";
}
boardid=sqlRst.getInt("boardid");
boardname=sqlRst.getString("boardname");
out.write(" \r\n");
out.write(" <option value=\"");
out.print(boardid);
out.write('"');
out.write(' ');
out.print(sel);
out.write('>');
out.print(boardname);
out.write("</option> \r\n");
i++;
} //end while
sqlRst.close();
out.write("</select>\r\n");
out.write(" <p align=\"center\">用户:<input type=\"text\" name=\"boardmaster\" size=\"20\"></p> \r\n");
out.write(" <p align=\"center\">密码:<input type=\"password\" name=\"masterpwd\" size=\"20\"></p> \r\n");
out.write(" <p align=\"center\"><input class=\"buttonface\" type=\"submit\" value=\"确定\" name=\"B1\"> \r\n");
out.write(" <input class=\"buttonface\" type=\"reset\" value=\"重写\" name=\"B2\"></p> \r\n");
out.write(" </form> \r\n");
out.write(" </td> \r\n");
out.write(" </tr> \r\n");
out.write("</table> \r\n");
out.write(" </center> \r\n");
out.write("</div> \r\n");
out.write("<!---------------------------------------------------------------> \r\n");
}
out.write("\r\n");
out.write("\r\n");
out.write("</body> \r\n");
out.write("</html> \r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -