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

📄 userlist_jsp.java

📁 jsp mysql 实现网上购物系统
💻 JAVA
字号:
package org.apache.jsp.manage;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import com.mybusiness.web.ware.shopuser;

public final class userlist_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,
      			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");
      out.write("\r\n");

if (session.getAttribute("admin")==null || session.getAttribute("admin")==""){
	response.sendRedirect("error.htm");
} 
      out.write("\r\n");
      out.write("\r\n");
      com.mybusiness.web.usermn user = null;
      synchronized (_jspx_page_context) {
        user = (com.mybusiness.web.usermn) _jspx_page_context.getAttribute("user", PageContext.PAGE_SCOPE);
        if (user == null){
          user = new com.mybusiness.web.usermn();
          _jspx_page_context.setAttribute("user", user, PageContext.PAGE_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');

int pages=1;
String mesg = "";

if (request.getParameter("page")!=null && !request.getParameter("page").equals("")) {
	String requestpage = request.getParameter("page");	
	try {
		pages = Integer.parseInt(requestpage);
	} catch(Exception e) {
		mesg = "你要找的页码错误!";
	}
	user.setPage(pages);
}

if (request.getParameter("action")!=null && request.getParameter("action").equals("del")){
	try{
		long id = Long.parseLong(request.getParameter("userid"));
		if (user.delete(id)) {
			mesg = "删除操作成功";
		} else {
			mesg = "删除操作出错";
		}
	} catch (Exception e) {
		mesg = "你要删除的用户号错误";
	}
}


      out.write("\r\n");
      out.write("\r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<title>商场翱游管理系统</title>\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
      out.write("<script language=\"javascript\">\r\n");
      out.write("<!--\r\n");
      out.write("  function checkform() {\r\n");
      out.write("\tif (document.form1.username.value==\"\" || document.form1.passwd.value==\"\"){\r\n");
      out.write("\t\talert(\"用户名或密码为空!\");\r\n");
      out.write("\t\treturn false;\r\n");
      out.write("\t}\r\n");
      out.write("\treturn true;\r\n");
      out.write("\r\n");
      out.write("  }\r\n");
      out.write("\r\n");
      out.write("function openScript(url,name, width, height){\r\n");
      out.write("\tvar Win = window.open(url,name,'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );\r\n");
      out.write("}\r\n");
      out.write("-->\r\n");
      out.write("</script>\r\n");
      out.write("<link rel=\"stylesheet\" href=\"books.css\" type=\"text/css\">\r\n");
      out.write("</head>\r\n");
      out.write("\r\n");
      out.write("<body  background=../images/112.gif text=\"#000000\">\r\n");
      out.write("<div align=\"center\">\r\n");
      out.write("  <table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">\r\n");
      out.write("    <tr> \r\n");
      out.write("      <td align=\"center\" width=\"20%\"></td>\r\n");
      out.write("       <td align=\"center\" width=\"100%\"><img src=\"../images/baners.gif\" width=\"600\" height=\"100\"></td>\r\n");
      out.write("    </tr>\r\n");
      out.write("    <tr>\r\n");
      out.write("      <td align=\"center\" width=\"20%\" valign=\"top\">\r\n");
      out.write("        <table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\" >\r\n");
      out.write("          <tr> \r\n");
      out.write("            <td>&nbsp;</td>\r\n");
      out.write("          </tr>\r\n");
      out.write("          <tr>\r\n");
      out.write("            <td align=\"center\"><a href=\"main.jsp\">回管理首页</a></td>\r\n");
      out.write("          </tr>\r\n");
      out.write("          <tr> \r\n");
      out.write("            <td align=\"center\"><a href=\"warelist.jsp\">商店商品查询</a></td>\r\n");
      out.write("          </tr>\r\n");
      out.write("          <tr> \r\n");
      out.write("            <td align=\"center\"><a href=\"addsort.jsp\">添加商品类别</a></td>\r\n");
      out.write("          </tr>\r\n");
      out.write("          <tr> \r\n");
      out.write("            <td align=\"center\"><a href=\"addware.jsp\">添加商品资料</a></td>\r\n");
      out.write("          </tr>\r\n");
      out.write("          <tr> \r\n");
      out.write("            <td align=\"center\"><a href=\"orderlist.jsp\">订单信息查询</a></td>\r\n");
      out.write("          </tr>\r\n");
      out.write("          <tr> \r\n");
      out.write("            <td align=\"center\"><a href=\"userlist.jsp\">用户信息查询</a></td>\r\n");
      out.write("          </tr>\r\n");
      out.write("          <tr> \r\n");
      out.write("            <td align=\"center\"><a href=\"logout.jsp\">退出</a></td>\r\n");
      out.write("          </tr>\r\n");
      out.write("        </table>\r\n");
      out.write("      </td>\r\n");
      out.write("      <td align=\"center\" width=\"80%\">\r\n");
      out.write("        <p>欢迎你,商场翱游购物系统管理员同志。...............</p>\r\n");
      out.write("        <p>商场翱游购物系统用户情况:</p>");
 if (!mesg.equals("")) out.println("<font color=red>"+ mesg +"</font><br><br>");
      out.write("\r\n");
      out.write("        <table width=\"95%\" border=\"1\" cellspacing=\"1\" cellpadding=\"1\" bordercolor=\"#2DAE2D\">\r\n");
      out.write("          <tr align=\"center\"> \r\n");
      out.write("            <td>用户ID号</td>\r\n");
      out.write("            <td>用户名</td>\r\n");
      out.write("            <td>真实姓名</td>\r\n");
      out.write("            <td>联系地址</td>\r\n");
      out.write("            <td>联系电话</td>\r\n");
      out.write("\t\t\t<td>Email</td>\r\n");
      out.write("\t\t\t<td>查看</td>\r\n");
      out.write("          </tr>\r\n");
 
if (user.execute()){
	for(int i=0; i<user.getUserlist().size(); i++){
		shopuser userinfo = (shopuser) user.getUserlist().elementAt(i);

      out.write("\r\n");
      out.write("          <tr>\r\n");
      out.write("            <td align=center>");
      out.print( userinfo.getId());
      out.write("</td>\r\n");
      out.write("            <td>");
      out.print( userinfo.getUserName());
      out.write("</td>\r\n");
      out.write("            <td>");
      out.print( userinfo.getNames());
      out.write("</td>\r\n");
      out.write("            <td>");
      out.print( userinfo.getAddress());
      out.write("</td>\r\n");
      out.write("            <td>");
      out.print( userinfo.getPhone());
      out.write("</td>\r\n");
      out.write("\t\t\t<td>");
      out.print( userinfo.getEmail());
      out.write("</td>\r\n");
      out.write("            <td align=center><a href=\"#\" onclick=\"openScript('showuser.jsp?userid=");
      out.print( userinfo.getId() );
      out.write("','showuser',450,500)\">详细资料</a>&nbsp;<a href=\"userlist.jsp?userid=");
      out.print( userinfo.getId());
      out.write("&page=");
      out.print( user.getPage());
      out.write("&action=del\" onclick=\"return(confirm('你真的要删除这个用户?'))\">删除</a></td>\r\n");
      out.write("          </tr>\r\n");
	}
}
      out.write("\r\n");
      out.write("\r\n");
      out.write("        </table>\r\n");
      out.write("\t\t<table width=\"90%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">\r\n");
      out.write("          <tr>\r\n");
      out.write("            <td align=\"right\">当前页第");
      out.print( user.getPage() );
      out.write("页 <a href=\"userlist.jsp\">首页</a>&nbsp; \r\n");
      out.write("              ");
 if (user.getPage()>1) {
      out.write("\r\n");
      out.write("              <a href=\"userlist.jsp?page=");
      out.print( user.getPage()-1 );
      out.write("\">上一页</a>&nbsp; \r\n");
      out.write("              ");
 } 
      out.write("\r\n");
      out.write("              ");
 if (user.getPage()<user.getPageCount()-1) {
      out.write("\r\n");
      out.write("              <a href=\"userlist.jsp?page=");
      out.print( user.getPage()+1 );
      out.write("\">下一页</a>&nbsp; \r\n");
      out.write("              ");
 } 
      out.write("\r\n");
      out.write("              <a href=\"userlist.jsp?page=");
      out.print( user.getPageCount() );
      out.write("\">未页</a>&nbsp;</td>\r\n");
      out.write("          </tr>\r\n");
      out.write("        </table>\r\n");
      out.write("        <p>&nbsp;</p>\r\n");
      out.write("      </td>\r\n");
      out.write("    </tr>\r\n");
      out.write("  </table>\r\n");
      out.write("  <br>\r\n");
      out.write("  <table width=\"70%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">\r\n");
      out.write("    <tr>\r\n");
      out.write("      <td align=\"center\">开发:王文耀<br>\r\n");
      out.write("        CopyRight@2005 <br>\r\n");
      out.write("        Email:<a href=\"mailto:wwy170@163.com\">wwy170@163.com</a></td>\r\n");
      out.write("    </tr>\r\n");
      out.write("  </table>\r\n");
      out.write("  \r\n");
      out.write("</div>\r\n");
      out.write("</body>\r\n");
      out.write("</html>\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 + -