📄 register_jsp.java
字号:
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import com.db.*;
public final class register_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
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=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\n\r\n<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n\r\n<title>注册会员</title>\r\n<script language=\"javascript\" type=\"\">\r\nfunction tj(){\r\n if(form1.username.value==\"\"){\r\n alert(\"对不起,用户名不能为空!\");\r\n form1.username.focus();\r\n return false;\r\n }\r\n if(form1.password.value==\"\"){\r\n alert(\"对不起,密码不能为空!\");\r\n form1.password.focus();\r\n return false;\r\n }\r\n if(form1.password.value!=form1.repawd.value){\r\n alert(\"对不起,两次密码不一致!\");\r\n form1.password.focus();\r\n return false;\r\n }\r\n}\r\nfunction openWindow(theURL,winName,features) { //v2.0\r\n window.open(theURL,winName,features);\r\n}\r\n</script>\r\n</head>\r\n");
String flag = request.getParameter("flag");
if(flag!=null&&!flag.equals("")){
Register rs = new Register();;
if(rs.register(request)){
out.print("<h1>注册成功!</h1>");
out.print("<h1><a href='login.jsp'>去登录</h1>");
return;
}else{
out.println(rs.getMessage());//提示信息
out.print("<h1>注册失败!</h1>");
out.print("<h1><a href='javascript:history.back();'>返回</h1>");
return;
}
}
out.write("\r\n<body>\r\n<h1 align=\"center\">注册用户</h1>\r\n<form action=\"\" method=\"post\" name=\"form1\" onsubmit=\"return tj();\">\r\n <input type=\"hidden\" name=\"flag\" value=\"res\"/>\r\n<table width=\"380\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n <tr>\r\n <td align=\"center\">用户名:</td>\r\n <td><input type=\"text\" name=\"username\">\r\n <input type=\"button\" value=\"检验用户\" onclick=\"openWindow('user_logic.jsp?name='+form1.username.value,'','width=300,height=200')\"/></td>\r\n </tr>\r\n <tr>\r\n <td align=\"center\">密 码:</td>\r\n <td><input type=\"password\" name=\"password\"></td>\r\n </tr>\r\n <tr>\r\n <td align=\"center\">确认密码:</td>\r\n <td><input type=\"password\" name=\"repawd\"></td>\r\n </tr>\r\n <tr>\r\n <td align=\"center\">性 别:</td>\r\n <td><input type=\"radio\" name=\"sex\" value=\"男\">\r\n 男\r\n <input type=\"radio\" name=\"sex\" value=\"女\">\r\n 女</td>\r\n </tr>\r\n <tr>\r\n <td align=\"center\">电子邮件:</td>\r\n <td><input type=\"text\" name=\"email\"></td>\r\n </tr>\r\n <tr>\r\n <td align=\"center\">地 址:</td>\r\n <td><input type=\"text\" name=\"adress\"></td>\r\n");
out.write(" </tr>\r\n <tr>\r\n <td align=\"center\"><input type=\"submit\" name=\"Submit\" value=\"提交\"></td>\r\n <td><input type=\"reset\" name=\"Submit\" value=\"重置\"></td>\r\n </tr>\r\n</table>\r\n</form>\r\n</body>\r\n</html>\r\n\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 + -