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

📄 checkusername_0002ejsp_jsp.java

📁 网上购物系统 用JSP做的 好几十页 用jbuilder运行
💻 JAVA
字号:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;


public class checkUserName_0002ejsp_jsp extends HttpJspBase {

    // begin [file="/checkUserName.jsp";from=(1,0);to=(1,60)]
    // end
    // begin [file="/checkUserName.jsp";from=(2,0);to=(2,58)]
    // end

    static {
    }
    public checkUserName_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="/checkUserName.jsp";from=(0,100);to=(1,0)]
                out.write("\r\n");

            // end
            // begin [file="/checkUserName.jsp";from=(1,0);to=(1,60)]
                beans.connDB connDB = null;
                boolean _jspx_specialconnDB  = false;
                 synchronized (pageContext) {
                    connDB= (beans.connDB)
                    pageContext.getAttribute("connDB",PageContext.PAGE_SCOPE);
                    if ( connDB == null ) {
                        _jspx_specialconnDB = true;
                        try {
                            connDB = (beans.connDB) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "beans.connDB");
                        } catch (ClassNotFoundException exc) {
                             throw new InstantiationException(exc.getMessage());
                        } catch (Exception exc) {
                             throw new ServletException (" Cannot create bean of class "+"beans.connDB", exc);
                        }
                        pageContext.setAttribute("connDB", connDB, PageContext.PAGE_SCOPE);
                    }
                 } 
                if(_jspx_specialconnDB == true) {
            // end
            // begin [file="/checkUserName.jsp";from=(1,0);to=(1,60)]
                }
            // end
            // HTML // begin [file="/checkUserName.jsp";from=(1,60);to=(2,0)]
                out.write("\r\n");

            // end
            // begin [file="/checkUserName.jsp";from=(2,0);to=(2,58)]
                beans.chStr chStr = null;
                boolean _jspx_specialchStr  = false;
                 synchronized (pageContext) {
                    chStr= (beans.chStr)
                    pageContext.getAttribute("chStr",PageContext.PAGE_SCOPE);
                    if ( chStr == null ) {
                        _jspx_specialchStr = true;
                        try {
                            chStr = (beans.chStr) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "beans.chStr");
                        } catch (ClassNotFoundException exc) {
                             throw new InstantiationException(exc.getMessage());
                        } catch (Exception exc) {
                             throw new ServletException (" Cannot create bean of class "+"beans.chStr", exc);
                        }
                        pageContext.setAttribute("chStr", chStr, PageContext.PAGE_SCOPE);
                    }
                 } 
                if(_jspx_specialchStr == true) {
            // end
            // begin [file="/checkUserName.jsp";from=(2,0);to=(2,58)]
                }
            // end
            // HTML // begin [file="/checkUserName.jsp";from=(2,58);to=(3,0)]
                out.write("\r\n");

            // end
            // begin [file="/checkUserName.jsp";from=(3,2);to=(6,0)]
                
                String username=chStr.chStr(request.getParameter("username"));
                ResultSet rs=connDB.executeQuery("select * from tb_member where username='"+username+"'");
            // end
            // HTML // begin [file="/checkUserName.jsp";from=(6,2);to=(20,3)]
                out.write("\r\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n<html>\r\n<head>\r\n<title>检测用户名</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n<link href=\"CSS/style.css\" rel=\"stylesheet\">\r\n</head>\r\n\r\n<body>\r\n      <table width=\"90%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n        <tr>\r\n          <td height=\"7\" align=\"center\">&nbsp;</td>\r\n        </tr>\t  \r\n\t  ");

            // end
            // begin [file="/checkUserName.jsp";from=(20,5);to=(22,3)]
                
                	  if(rs.next()){
                	  
            // end
            // HTML // begin [file="/checkUserName.jsp";from=(22,5);to=(25,41)]
                out.write("\r\n\r\n        <tr>\r\n          <td height=\"45\" align=\"center\">");

            // end
            // begin [file="/checkUserName.jsp";from=(25,43);to=(25,94)]
                out.println("很报歉!<br><br>["+username+"]用户名已经被注册!");
            // end
            // HTML // begin [file="/checkUserName.jsp";from=(25,96);to=(27,1)]
                out.write("</td>\r\n        </tr>\r\n\t");

            // end
            // begin [file="/checkUserName.jsp";from=(27,3);to=(27,9)]
                }else{
            // end
            // HTML // begin [file="/checkUserName.jsp";from=(27,11);to=(29,41)]
                out.write("\r\n        <tr>\r\n          <td height=\"56\" align=\"center\">");

            // end
            // begin [file="/checkUserName.jsp";from=(29,43);to=(29,94)]
                out.println("祝贺您!<br><br>["+username+"]用户名没有被注册!");
            // end
            // HTML // begin [file="/checkUserName.jsp";from=(29,96);to=(31,1)]
                out.write("</td>\r\n        </tr>\t\r\n\t");

            // end
            // begin [file="/checkUserName.jsp";from=(31,3);to=(31,4)]
                }
            // end
            // HTML // begin [file="/checkUserName.jsp";from=(31,6);to=(35,0)]
                out.write("\r\n    </table>\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 + -