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

📄 reg3_0002ejsp_jsp.java

📁 基于J2EE的个人数字助理系统,大家参考下,提出宝贵意见
💻 JAVA
字号:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;


public class reg3_0002ejsp_jsp extends HttpJspBase {


    static {
    }
    public reg3_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=gb2312");
            pageContext = _jspxFactory.getPageContext(this, request, response,
            			"", true, 8192, true);

            application = pageContext.getServletContext();
            config = pageContext.getServletConfig();
            session = pageContext.getSession();
            out = pageContext.getOut();

            // HTML // begin [file="/reg3.jsp";from=(0,100);to=(20,0)]
                out.write("\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\" />\r\n<title>注册成功</title>\r\n<style type=\"text/css\">\r\n   <!--\r\n   a:link { text-decoration: none;color: #FF6600}\r\n   a:active { text-decoration:blink}\r\n   a:hover { text-decoration:underline;color: red}\r\n   a:visited { text-decoration: none;color: green}\r\n     body {\r\n\tbackground-color: #99CCFF;\r\n         }\r\n   -->\r\n   </style>\r\n</head>\r\n<style type=\"text/css\"></style>\r\n<body>\r\n");

            // end
            // begin [file="/reg3.jsp";from=(20,2);to=(60,0)]
                
                //读取表单内容
                String uid=request.getParameter("uid");
                String nickname=request.getParameter("nickname");
                byte [] tmpbyte=nickname.getBytes("ISO8859_1");
                nickname=new String(tmpbyte);
                String gender=request.getParameter("gender");
                tmpbyte=gender.getBytes("ISO8859_1");
                gender=new String(tmpbyte);
                String pwd=request.getParameter("pwd");
                String name=request.getParameter("name");
                tmpbyte=name.getBytes("ISO8859_1");
                name=new String(tmpbyte);
                String career=request.getParameter("career");
                tmpbyte=career.getBytes("ISO8859_1");
                career=new String(tmpbyte);
                String address=request.getParameter("address");
                tmpbyte=address.getBytes("ISO8859_1");
                address=new String(tmpbyte);
                String email=request.getParameter("email");
                String tel=request.getParameter("tel");
                String year=request.getParameter("year");
                String month=request.getParameter("month");
                String date=request.getParameter("date");
                String birth=year+"-"+month+"-"+date;
                 try{
                		Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                	        }catch(ClassNotFoundException e){
                		       System.out.println(e.getMessage());
                	}
                      String sql="insert into custom values('"+uid+"','"+pwd+"','"+nickname+"','"+gender+"','"+name+"','"+address+"','"+email+"','"+tel+"','"+birth+"','"+career+"')";
                //将记录添加到数据库中
                              try{
                                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                		Connection cnCon = DriverManager.getConnection("jdbc:odbc:shm"," "," ");
                		Statement stmt = cnCon.createStatement();
                		ResultSet rs = stmt.executeQuery(sql);
                        }catch(SQLException e){
                		System.out.println(e.getMessage());
                	}
            // end
            // HTML // begin [file="/reg3.jsp";from=(60,2);to=(61,25)]
                out.write("\r\n<p><font color=\"#CC0033\">");

            // end
            // begin [file="/reg3.jsp";from=(61,28);to=(61,31)]
                out.print(uid);
            // end
            // HTML // begin [file="/reg3.jsp";from=(61,33);to=(68,0)]
                out.write("</font>:恭喜你,注册成功!</p>\r\n<p align=\"center\">&nbsp;</p>\r\n<br />\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 + -