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

📄 deleteuser_jsp.java

📁 这是一个图书馆系统
💻 JAVA
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;

public final class deleteuser_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=gb2312");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			"", 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("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
      out.write("<title>Delete user</title>\r\n");
      out.write("<style type=\"text/css\">\r\n");
      out.write("<!--\r\n");
      out.write(".style3 {font-size: 24px}\r\n");
      out.write(".style4 {font-size: 18px}\r\n");
      out.write("-->\r\n");
      out.write("</style></head>\r\n");
      out.write("\r\n");
      out.write("<body>\r\n");
      out.write("<form name=\"form1\" method=\"post\" action=\"\">\r\n");
      out.write("  <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("    <tr align=\"left\" valign=\"top\" bgcolor=\"#000000\">\r\n");
      out.write("      <td height=\"100\" colspan=\"2\"><table width=\"100%\" border=\"0\" align=\"left\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#FFFFFF\">\r\n");
      out.write("        <tr>\r\n");
      out.write("          <td bgcolor=\"#FFFFFF\"><img src=\"F:\\example\\图书馆\\login\\library1.gif\" width=\"699\" height=\"100\" alt=\"\"></td>\r\n");
      out.write("        </tr>\r\n");
      out.write("      </table></td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr>\r\n");
      out.write("      <td height=\"449\" align=\"left\" valign=\"top\" bgcolor=\"#000000\"><table width=\"99%\" border=\"0\" align=\"left\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#FFFFFF\">\r\n");
      out.write("        <tr>\r\n");
      out.write("          <td valign=\"top\" bgcolor=\"#CCCCCC\"><table width=\"70%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#CCCCCC\">\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td width=\"20\" align=\"right\">&nbsp;</td>\r\n");
      out.write("              <td width=\"130\" align=\"center\">&nbsp;</td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td width=\"20\" align=\"right\"><img src=\"F:\\example\\图书馆\\login/library3.png\" width=\"10\" height=\"10\" alt=\"\"></td>\r\n");
      out.write("              <td width=\"130\" align=\"center\"> <a href=\"adduser.jsp\">Adduser</a> </td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td width=\"20\" height=\"5\" align=\"right\">&nbsp;</td>\r\n");
      out.write("              <td width=\"130\" height=\"5\" align=\"center\"><img src=\"F:\\example\\图书馆\\login/library4.png\" width=\"102\" height=\"5\" alt=\"\"></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td width=\"20\" align=\"right\"><img src=\"F:\\example\\图书馆\\login/library3.png\" width=\"10\" height=\"10\" alt=\"\"></td>\r\n");
      out.write("              <td width=\"130\" align=\"center\"><a href=\"modifyuser.jsp\">Modifyuser</a></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td width=\"20\" height=\"5\" align=\"right\">&nbsp;</td>\r\n");
      out.write("              <td width=\"130\" height=\"5\" align=\"center\"><img src=\"F:\\example\\图书馆\\login/library4.png\" width=\"102\" height=\"5\" alt=\"\"></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td width=\"20\" align=\"right\"><img src=\"F:\\example\\图书馆\\login/library3.png\" width=\"10\" height=\"10\" alt=\"\"></td>\r\n");
      out.write("              <td width=\"130\" align=\"center\"><a href=\"deleteuser.jsp\">Deletuser</a></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td width=\"20\" align=\"right\">&nbsp;</td>\r\n");
      out.write("              <td width=\"130\" align=\"center\"><img src=\"F:\\example\\图书馆\\login/library4.png\" width=\"102\" height=\"5\" alt=\"\"></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td width=\"20\" align=\"right\"><img src=\"F:\\example\\图书馆\\login/library3.png\" width=\"10\" height=\"10\" alt=\"\"></td>\r\n");
      out.write("              <td width=\"130\" align=\"center\"><a href=\"searchuser.jsp\">Searchuser</a></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td width=\"20\" align=\"right\">&nbsp;</td>\r\n");
      out.write("              <td width=\"130\" align=\"center\"><img src=\"F:\\example\\图书馆\\login/library4.png\" width=\"102\" height=\"5\" alt=\"\"></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("             <td width=\"20\" align=\"right\"><img src=\"F:\\example\\图书馆\\login/library3.png\" width=\"10\" height=\"10\" alt=\"\"></td>\r\n");
      out.write("              <td width=\"130\" align=\"center\"><a href=\"addbook.jsp\">Addbook</a></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td width=\"20\" align=\"right\">&nbsp;</td>\r\n");
      out.write("              <td width=\"130\" align=\"center\"><img src=\"F:\\example\\图书馆\\login/library4.png\" width=\"102\" height=\"5\" alt=\"\"></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td align=\"right\"><img src=\"F:\\example\\图书馆\\login/library3.png\" width=\"10\" height=\"10\" alt=\"\"></td>\r\n");
      out.write("              <td align=\"center\"><a href=\"deletebook.jsp\">Deletebook</a></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td align=\"right\">&nbsp;</td>\r\n");
      out.write("              <td align=\"center\"><img src=\"F:\\example\\图书馆\\loginlibrary4.png\" width=\"102\" height=\"5\" alt=\"\"></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td align=\"right\"><img src=\"F:\\example\\图书馆\\login/library3.png\" width=\"10\" height=\"10\" alt=\"\"></td>\r\n");
      out.write("              <td align=\"center\"><a href=\"borrowsearch.jsp\">Borrowsearch</a></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td align=\"right\">&nbsp;</td>\r\n");
      out.write("              <td align=\"center\"><img src=\"F:\\example\\图书馆\\login/library4.png\" width=\"102\" height=\"5\" alt=\"\"></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td align=\"right\"><img src=\"F:\\example\\图书馆\\login/library3.png\" width=\"10\" height=\"10\" alt=\"\"></td>\r\n");
      out.write("              <td align=\"center\"><a href=\"search.jsp\">Search</a></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td align=\"right\">&nbsp;</td>\r\n");
      out.write("              <td align=\"center\"><img src=\"F:\\example\\图书馆\\login/library4.png\" width=\"102\" height=\"5\" alt=\"\"></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td align=\"right\"><img src=\"F:\\example\\图书馆\\login/library3.png\" width=\"10\" height=\"10\" alt=\"\"></td>\r\n");
      out.write("              <td align=\"center\"><a href=\"userpay.jsp\">Userpay</a></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td align=\"right\">&nbsp;</td>\r\n");
      out.write("              <td align=\"center\"><img src=\"F:\\example\\图书馆\\login/library4.png\" width=\"102\" height=\"5\" alt=\"\"></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("             <tr>\r\n");
      out.write("              <td align=\"right\"><img src=\"F:\\example\\图书馆\\login/library3.png\" width=\"10\" height=\"10\" alt=\"\"></td>\r\n");
      out.write("              <td align=\"center\"><a href=\"update.jsp\">Update</a></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td align=\"right\">&nbsp;</td>\r\n");
      out.write("              <td align=\"center\"><img src=\"F:\\example\\图书馆\\login/library4.png\" width=\"102\" height=\"5\" alt=\"\"></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td width=\"20\" align=\"right\">&nbsp;</td>\r\n");
      out.write("              <td width=\"130\" align=\"center\">&nbsp;</td>\r\n");
      out.write("            </tr>\r\n");
      out.write("          </table></td>\r\n");
      out.write("        </tr>\r\n");
      out.write("        <tr>\r\n");
      out.write("          <td height=\"200\" valign=\"top\" bgcolor=\"#CCCCCC\">&nbsp;</td>\r\n");
      out.write("        </tr>\r\n");
      out.write("      </table></td>\r\n");
      out.write("      <td height=\"449\" align=\"left\" valign=\"top\"><table width=\"80%\" border=\"1\" align=\"center\" cellpadding=\"10\" cellspacing=\"1\">\r\n");
      out.write("        <tr align=\"center\">\r\n");
      out.write("          <td height=\"50\" colspan=\"2\"><span class=\"style3\">Delete user </span></td>\r\n");
      out.write("          </tr>\r\n");
      out.write("        <tr>\r\n");
      out.write("          <td width=\"37%\" height=\"30\" align=\"right\" ><span class=\"style4\">ID:</span></td>\r\n");
      out.write("          <td width=\"63%\" height=\"30\"><span class=\"style4\">\r\n");
      out.write("          <input name=\"deleteuserid\" type=\"text\" id=\"deleteuserid\" size=\"15\" maxlength=\"12\">\r\n");
      out.write("          ***</span></td>\r\n");
      out.write("        </tr>\r\n");
      out.write("        <tr>\r\n");
      out.write("          <td height=\"30\" colspan=\"2\" align=\"right\">            <table width=\"60%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"1\">\r\n");
      out.write("            <tr>\r\n");
      out.write("              <td width=\"50%\" align=\"center\"><input name=\"deleteuserenter\" type=\"submit\" id=\"deleteuserenter\" value=\"Enter\"></td>\r\n");
      out.write("              <td width=\"50%\" align=\"center\"><input name=\"deleteuserreset\" type=\"reset\" id=\"deleteuserreset\" value=\"Reset\"></td>\r\n");
      out.write("            </tr>\r\n");
      out.write("          </table></td>\r\n");
      out.write("          </tr>\r\n");
      out.write("      </table></td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr>\r\n");
      out.write("      <td bgcolor=\"#666666\">&nbsp;</td>\r\n");
      out.write("      <td><img src=\"F:\\example\\图书馆\\login/library2.png\" width=\"573\" height=\"40\" alt=\"\"></td>\r\n");
      out.write("    </tr>\r\n");
      out.write("  </table>\r\n");
      out.write("</form>\r\n");
      login.Library Library = null;
      synchronized (session) {
        Library = (login.Library) _jspx_page_context.getAttribute("Library", PageContext.SESSION_SCOPE);
        if (Library == null){
          Library = new login.Library();
          _jspx_page_context.setAttribute("Library", Library, PageContext.SESSION_SCOPE);
          out.write('\r');
          out.write('\n');
        }
      }
      out.write("\r\n");
      out.write("<center>\r\n");
      out.write("\r\n");



try{
  if(request.getParameter("deleteuserenter")!=null){
    Connection conn=Library.getConn();
  Statement stmt=conn.createStatement();
String id = request.getParameter("deleteuserid");

    String deleteStr = "delete from user where id ='" + id + "'";
    stmt.execute(deleteStr);
    response.sendRedirect("success.jsp");
  }

}catch (Exception ex) {
  response.sendRedirect("fail.jsp");
ex.printStackTrace();}


      out.write("\r\n");
      out.write("</center>\r\n");
      out.write("</body>\r\n");
      out.write("</html>\r\n");
      out.write("\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 + -