📄 in1_0002ejsp_jsp.java
字号:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
public class in1_0002ejsp_jsp extends HttpJspBase {
static {
}
public in1_0002ejsp_jsp( ) {
}
private static boolean _jspx_inited = false;
public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
}
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;
String _value = null;
try {
if (_jspx_inited == false) {
synchronized (this) {
if (_jspx_inited == false) {
_jspx_init();
_jspx_inited = true;
}
}
}
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=GBK");
pageContext = _jspxFactory.getPageContext(this, request, response,
"", true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
// HTML // begin [file="/in1.jsp";from=(0,48);to=(1,0)]
out.write("\r\n");
// end
// HTML // begin [file="/in1.jsp";from=(1,30);to=(2,0)]
out.write("\r\n");
// end
// begin [file="/in1.jsp";from=(2,2);to=(24,0)]
//第一步:获取login1.htm页面表单体叫过来的元素值
String stryhm, strmm;
stryhm = request.getParameter("username");
strmm = request.getParameter("pasw");
//第二步:加载驱动
String sql="select * from xgxx where yhm='"+stryhm+"'";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//第三步:架桥,并执行SQL
Connection cnCon = DriverManager.getConnection("jdbc:odbc:login" );
Statement stmt = cnCon.createStatement();
ResultSet rs = stmt.executeQuery(sql);
if(rs.next())
{
//用户ID已经被其他申请
rs.close();
stmt.close();
cnCon.close();
// end
// HTML // begin [file="/in1.jsp";from=(24,2);to=(28,0)]
out.write("\r\n<p>对不起!您选择的用户名已经被其他人申请,请重新选择!</p>\r\n<p><input name=\"Button2\" type=\"button\" class=\"button1\" onClick=\"backward()\" value=\"返回上一步\">\r\n</p>\r\n");
// end
// begin [file="/in1.jsp";from=(28,2);to=(33,0)]
}
else{
String sqls = "insert into xgxx (yhm,mm)values('"+stryhm+"','"+strmm+"')";
ResultSet rs1 = stmt.executeQuery(sqls);
rs.close();}
// end
// HTML // begin [file="/in1.jsp";from=(33,2);to=(45,0)]
out.write("\r\n<html>\r\n<head>\r\n<title>\r\n注册\r\n</title>\r\n</head>\r\n<body bgcolor=\"#ffffff\">\r\n单击!\r\n<a href=\"login.html\">这里</a>返回登录页面!\r\n</body>\r\n</html>\r\n");
// end
} catch (Throwable t) {
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (pageContext != null) pageContext.handlePageException(t);
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -