📄 customerlist_jsp.java
字号:
package org.apache.jsp.customer;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.Collection;
import java.util.Iterator;
import bean.CustomerBean;;
public final class customerlist_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
static {
_jspx_dependants = new java.util.Vector(1);
_jspx_dependants.add("/customer/../customer/search1.jsp");
}
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=GBK");
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\r\n\r\n");
out.write("\r\n<html>\t\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=GBK\" />\r\n<title></title>\r\n<script language=\"javascript\">\r\nfunction search_sub()\r\n{\r\nif(document.search_form.keyword.value==\"\")\r\n{\r\n window.alert(\"请输入关键字!\");\r\n document.search_form.keyword.focus();\r\n return;\r\n }\r\ndocument.search_form.submit();\r\n \r\n }\r\n</script>\r\n<form name=\"search_form\" method=\"post\" action=\"/wyweb/SearchCustomerServlet\">\r\n <table width=\"764\" height=\"20\" align=\"center\">\r\n <tr bgcolor=\"#0099CC\"> \r\n <td width=\"94\" height=\"10\"> \r\n <div align=\"center\">客户查询:</div></td>\r\n <td width=\"316\" height=\"10\">\r\n<div align=\"center\">请输入关键字: \r\n <input type=\"text\" name=\"keyword\" value=\"请输入关键字\" \r\n onmouseover=\"this.focus()\" onFocus=\"this.select()\">\r\n </div></td>\r\n <td width=\"263\" height=\"10\">\r\n<div align=\"center\">请选择查询范围: \r\n <select name=\"way\" size=\"1\">\r\n <option value=\"1\">客户名称</option>\r\n <option value=\"2\">客户姓名</option>\r\n");
out.write(" <option value=\"3\">客户电话号码</option>\r\n <option value=\"4\">客户身份证号码</option>\r\n <option value=\"5\">客户E-mail</option>\r\n </select>\r\n </div></td>\r\n <td width=\"117\" height=\"10\"> \r\n <div align=\"center\"> \r\n <input type=\"submit\" name=\"Submit\" value=\"查询\" onClick=\"search_sub()\">\r\n </div></td>\r\n </tr>\r\n </table>\r\n</form>\r\n\r\n");
out.write("\r\n<body>\r\n<center>\r\n <table width=\"764\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n <tr>\r\n <td><style type=\"\">\r\n.t1 {\r\n\tFONT-SIZE: 10.5pt; WORD-BREAK: break-all; BORDER-COLLAPSE: collapse; TEXT-ALIGN: justify\r\n}\r\n </style></td>\r\n </tr>\r\n <tr>\r\n <td><table width=\"764\" align=\"center\">\r\n <tr bgcolor=\"#0099CC\">\r\n <td height=\"18\" colspan=\"4\"><div align=\"center\"><b><font color=\"#FFFFFF\">浏览客户信息</font></b></div></td>\r\n </tr>\r\n </table></td>\r\n </tr>\r\n </table>\r\n <table width=\"764\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n <tr> \r\n <td width=\"138\" height=\"20\" bgcolor=\"#3399ff\"> <font\r\n\t\t\t\t\tcolor=\"#ffffff\">用户名称</font></td>\r\n <td width=\"106\" height=\"20\" bgcolor=\"#3399ff\"> <font\r\n\t\t\t\t\tcolor=\"#ffffff\">用户性别</font></td>\r\n <td width=\"110\" height=\"20\" bgcolor=\"#3399ff\"> <font\r\n\t\t\t\t\tcolor=\"#ffffff\">E-mail</font></td>\r\n <td width=\"110\" height=\"20\" bgcolor=\"#3399ff\"> <font\r\n\t\t\t\t\tcolor=\"#ffffff\">用户电话</font></td>\r\n");
out.write(" <td width=\"124\" height=\"20\" bgcolor=\"#3399ff\"> <font\r\n\t\t\t\t\tcolor=\"#ffffff\">身份证号码</font></td>\r\n </tr>\r\n ");
if (request.getAttribute("c") == null) {
out.write("\r\n <tr> \r\n <td 75%\"\" colspan=5 bgcolor=\"#FCFCFC\" align=center>还没有任何客户信息。</td>\r\n </tr>\r\n ");
} else {
Collection c = (Collection) request.getAttribute("c");
if (c == null) {
out.write("\r\n <tr> \r\n <td colspan=5 bgcolor=\"#FCFCFC\" align=center>还没有任何客户信息。</td>\r\n </tr>\r\n ");
} else {
int totalPageNum = ((Integer) (request
.getAttribute("totalPageNum"))).intValue();
int currentPage = 1;
if (request.getParameter("page") != null) {
currentPage = Integer.parseInt(request
.getParameter("page"));
}
Iterator iterator = c.iterator();
while (iterator.hasNext()) {
CustomerBean customer = (CustomerBean) iterator.next();
out.write("\r\n <tr> \r\n <td width=\"238\" bgcolor=\"#FCFCFC\"><a\r\n\t\t\t\t\thref=\"ShowCustomerServlet?id=");
out.print(customer.getUserID());
out.write('"');
out.write(' ');
out.write('>');
out.print(customer.getLoginName());
out.write("</a></td>\r\n ");
if(customer.getSex().equals("1")){
out.write("\r\n <td width=\"196\" bgcolor=\"#FCFCFC\">男</td>\r\n ");
}else if(customer.getSex().equals("0")){
out.write("\r\n <td width=\"196\" bgcolor=\"#FCFCFC\">女</td>\r\n ");
}else{
out.write("\r\n <td width=\"196\" bgcolor=\"#FCFCFC\"> </td>\r\n ");
}
out.write("\r\n <td width=\"210\" bgcolor=\"#FCFCFC\">");
out.print(customer.getEmail());
out.write("</td>\r\n <td width=\"210\" bgcolor=\"#FCFCFC\">");
out.print(customer.getPhone());
out.write("</td>\r\n <td width=\"224\" bgcolor=\"#FCFCFC\">");
out.print(customer.getPerCode());
out.write("</td>\r\n </tr>\r\n ");
}
out.write("\r\n <form name=\"form1\" method=\"get\">\r\n <tr> \r\n <td colspan=5 align=right bgcolor=\"#EFEFEF\"> \r\n ");
for (int i = 1; i <= totalPageNum; i++) {
out.write("\r\n <a href=\"CustomerListServlet?page=");
out.print(i);
out.write('"');
out.write('>');
out.write('[');
out.print(i);
out.write("]</a> \r\n ");
}
out.write("\r\n 共[ ");
out.print(totalPageNum);
out.write(" ]页 \r\n <input type=\"text\" size=\"2\" name=\"page\" value=\"\"> <input type=\"submit\" name=\"go\" value=\"Go\"> \r\n </td>\r\n </tr>\r\n </form>\r\n ");
}
}
out.write("\r\n <tr> \r\n <td colspan=8 align=center height=\"35\"\r\n\t\t\t\t\t\tbgcolor=\"#EFEFEF\"> \r\n ");
//如果用户已经登录,则允许添加客户:
if (session.getAttribute("userName") != null) {
out.write("\r\n [ <a href=\"/wyweb/customer/customerpost.jsp\">添加客户信息</a>] \r\n ");
} else {
out.write("\r\n [ <a href=\"login.jsp\">登录</a>] \r\n ");
}
out.write("\r\n </tr>\r\n </table>\r\n </center>\r\n</body>\r\n</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 + -