📄 login_jsp.java
字号:
package org.apache.jsp.manage;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class login_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=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");
com.bookshop.dao.Login alogin = null;
synchronized (_jspx_page_context) {
alogin = (com.bookshop.dao.Login) _jspx_page_context.getAttribute("alogin", PageContext.PAGE_SCOPE);
if (alogin == null){
alogin = new com.bookshop.dao.Login();
_jspx_page_context.setAttribute("alogin", alogin, PageContext.PAGE_SCOPE);
}
}
out.write('\r');
out.write('\n');
String mesg = "";
if( request.getParameter("username")!=null && !request.getParameter("username").equals("")){
String username =request.getParameter("username");
String passwd = request.getParameter("passwd");
username = new String(username.getBytes("ISO8859-1"));
passwd = new String(passwd.getBytes("ISO8859-1"));
alogin.setUsername(username);
alogin.setPasswd(passwd);
alogin.setIsadmin(true);
if (alogin.excute()){
session.setAttribute("admin","admin");
out.write("\r\n");
out.write("\t\t");
if (true) {
_jspx_page_context.forward("main.jsp");
return;
}
out.write("\t\t\t\r\n");
}else {
mesg = "登录出错!" ;
}
}
out.write("\r\n");
out.write("\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<title>51网上书店管理系统</title>\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
out.write("<style>a{TEXT-DECORATION:none}a:hover{TEXT-DECORATION:underline}</style>\r\n");
out.write("<script language=\"JavaScript\">\r\n");
out.write("\t\tsetInterval(\"a.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());\",1000);\r\n");
out.write("\t\t</script>\r\n");
out.write("<script language=\"javascript\">\r\n");
out.write(" function checkform() {\r\n");
out.write("\tif (document.form1.username.value==\"\" || document.form1.passwd.value==\"\"){\r\n");
out.write("\t\talert(\"用户名或密码为空!\");\r\n");
out.write("\t\treturn false;\r\n");
out.write("\t}\r\n");
out.write("\treturn true;\r\n");
out.write("\r\n");
out.write(" }\r\n");
out.write("</script>\r\n");
out.write("<style type=\"text/css\">\r\n");
out.write("<!--\r\n");
out.write(".style14 {color: #3366FF}\r\n");
out.write(".style16 {font-size: 18px; color: #3366FF;}\r\n");
out.write(".style17 {font-size: 14px}\r\n");
out.write(".style18 {color: #3366FF; font-size: 14px; }\r\n");
out.write("-->\r\n");
out.write("</style>\r\n");
out.write("</head>\r\n");
out.write("\r\n");
out.write("<body text=\"#000000\">\r\n");
out.write("\t\t<div align=\"center\">\r\n");
out.write("\t\t\t<table width=\"750\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n");
out.write("\t\t\t\t<tr>\t\t\t\t\t\r\n");
out.write("\t\t\t\t\t<td align=\"center\"><img src=\"../images/title.jpg\" width=\"744\" height=\"100\"></td>\r\n");
out.write("\t\t\t\t</tr>\r\n");
out.write("\t\t\t</table>\r\n");
out.write("\r\n");
out.write("\t\t\t\r\n");
out.write("\t\t\t<table width=\"750\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\" >\r\n");
out.write("\t\t\t\t<tr>\r\n");
out.write("\t\t\t\t <td width=\"100\" height=\"30\" align=\"center\" background=\"../images/qntj.jpg\" class=\"style14\"><a href=\"../index.jsp\" class=\"style18\">首页</a></td>\r\n");
out.write("\t\t\t\t <td width=\"100\" align=\"center\" background=\"../images/qntj.jpg\" class=\"style14\"><a href=\"../booklist.jsp\" class=\"style18\">在线购物</a></td>\r\n");
out.write("\t\t\t\t <td width=\"100\" align=\"center\" background=\"../images/qntj.jpg\" class=\"style14\"><a href=\"../shoperlist.jsp\" class=\"style18\">我的购物车</a></td>\r\n");
out.write("\t\t\t\t <td width=\"100\" align=\"center\" background=\"../images/qntj.jpg\" class=\"style14\"><a href=\"../login.jsp\" class=\"style18\">用户登录</a></td>\r\n");
out.write("\t\t\t\t <td width=\"100\" align=\"center\" background=\"../images/qntj.jpg\" class=\"style14\"><a href=\"../manage/login.jsp\" class=\"style14 style17\">网站管理</a></td>\r\n");
out.write("\t\t\t\t <td width=\"250\" align=\"center\" background=\"../images/qntj.jpg\"><div id=\"a\"><span class=\"style7\"></span></div></td>\r\n");
out.write("\t\t\t\t</tr>\r\n");
out.write("\t\t </table>\r\n");
out.write("\t\t \r\n");
out.write(" <p> </p>\r\n");
out.write(" <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n");
out.write(" <tr> \r\n");
out.write(" <td align=\"center\"> \r\n");
out.write(" <form name=\"form1\" method=\"post\" action=\"login.jsp\"> \r\n");
out.write(" <table width=\"304\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#66CCFF\" style=\"font-size:9pt\">\r\n");
out.write(" <tr align=\"center\"> \r\n");
out.write(" <td colspan=\"2\"> \r\n");
out.write(" <font color=\"#FF0000\" class=\"style16\">51网上书店管理系统</font> \r\n");
out.write(" ");
if (!mesg.equals("")){
out.println(mesg);}
out.write(" \r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr> \r\n");
out.write(" <td width=\"106\" height=\"35\" align=\"right\" class=\"style14\">管理员</td>\r\n");
out.write(" <td width=\"192\"> \r\n");
out.write(" <input type=\"text\" name=\"username\" size=\"20\" maxlength=\"20\" height=\"20\">\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr> \r\n");
out.write(" <td width=\"106\" height=\"38\" align=\"right\" class=\"style14\">管理员密码</td>\r\n");
out.write(" <td> \r\n");
out.write(" <input type=\"password\" name=\"passwd\" size=\"20\" maxlength=\"20\" height=\"20\">\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr align=\"center\"> \r\n");
out.write(" <td height=\"40\" colspan=\"2\"> \r\n");
out.write(" <input type=\"submit\" name=\"Submit\" value=\"登录\" onclick=\"javascript:return(checkform());\"> \r\n");
out.write(" <input type=\"reset\" name=\"Submit2\" value=\"取消\">\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr align=\"center\">\r\n");
out.write(" <td colspan=\"2\"><A HREF=\"../index.jsp\" class=\"style16\">返回首页</A></td>\r\n");
out.write(" </tr>\r\n");
out.write(" </table>\r\n");
out.write(" <p> </p>\r\n");
out.write(" <p> </p>\r\n");
out.write(" </form>\r\n");
out.write("\t </table>\r\n");
out.write("\t \r\n");
out.write(" <hr width=\"750\" color=\"#00CCFe\"/>\r\n");
out.write("\t\t\t<table width=\"750\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n");
out.write("\t\t\t\t<tr>\r\n");
out.write("\t\t\t\t\t<td align=\"center\" >\r\n");
out.write("\t\t\t\t\t\t<div align=\"center\" class=\"style11\">51网络有限公司开发\r\n");
out.write("\t\t\t\t\t\t <br>\r\n");
out.write("\t\t\t\t\t\tCopyRight@2008\r\n");
out.write("\t\t\t\t\t\t<br>\r\n");
out.write("\t\t\t\t\t\tE-mail:\r\n");
out.write("\t\t\t\t\t\t<a href=\"mailto:dengxianghai2005@163.com\">dengxianghai2005@163.com</a>\r\n");
out.write("\t\t\t\t\t </div></td>\r\n");
out.write("\t\t\t\t</tr>\r\n");
out.write("\t\t\t</table>\r\n");
out.write("\r\n");
out.write("</div>\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)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -