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

📄 highquery_jsp.java

📁 简单的餐厅管理系统
💻 JAVA
字号:
package org.apache.jsp.admin;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
import beans.*;

public final class highQuery_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("/admin/../commonDealError.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");
      out.write("\r\n");
      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=GBK\">\r\n");
      out.write("<title>Insert title here</title>\r\n");
      out.write("</head>\r\n");
      out.write("<script type = \"text/javascript\">\r\n");
      out.write("\t");
      out.write("\tfunction load(){\r\n");
      out.write("\t\t");

			if(session.getAttribute("errorMsg") != null){
			
		
      out.write("\r\n");
      out.write("\t\t\tvar errorStr = \"");
      out.print( session.getAttribute("errorMsg"));
      out.write("\";\r\n");
      out.write("\t\t");

			session.setAttribute("errorMsg","");
			}else{
		
      out.write("\r\n");
      out.write("\t\t\tvar errorStr = \"\";\r\n");
      out.write("\t\t");

			}
		
      out.write("\r\n");
      out.write("\t\tif(errorStr.length >= 1){\r\n");
      out.write("\t\t\talert(errorStr);\r\n");
      out.write("\t\t}\r\n");
      out.write("\t}");
      out.write("\r\n");
      out.write("</script>\r\n");
      out.write("<body onload = load()>\r\n");
 
	Object o1 = session.getAttribute("dishesInfor");
	Hashtable table = (Hashtable)o1;
	if(table == null){
		table = new Hashtable();
	}
	Vector dishes = (Vector)table.get("dishes");
	Vector showType = (Vector)table.get("showType");
	Vector materialsName = (Vector)table.get("materialsName");
	Object o2 = session.getAttribute("type");
	int type = Integer.parseInt(o2.toString());

      out.write('\r');
      out.write('\n');
 
	if(type != 1){
		out.println("你不具有该权限!");
	}else{

      out.write("\r\n");
      out.write("\t<center>\r\n");
      out.write("\t<form action=\"../servlet/DishController\" method=\"post\">\r\n");
      out.write("\t\t\t<p>&nbsp</p>\r\n");
      out.write("\t\t\t按菜系查询:<select name=\"dishSorts\" style=\"width: 85px\">\r\n");
 
				if(showType == null){
					
      out.write("<h2>菜系暂缺</h2>");

				}else{

      out.write("\r\n");
      out.write("\t\t\t\t\t<option>all</option>\r\n");

					for(int i=0; i<showType.size(); i++){

      out.write("\r\n");
      out.write("\t\t\t\t\t\t<option>");
      out.print(showType.elementAt(i));
      out.write("</option>\r\n");

					}
				}

      out.write("\r\n");
      out.write("\t\t\t</select> \r\n");
      out.write("\t\t\t\r\n");
      out.write("\t\t\t按主料查询:\r\n");
      out.write("\t\t\t<select name=\"mains\" style=\"width: 85px\">\r\n");

				if(showType == null){
					
      out.write("<h2>主料暂缺</h2>");

				}else{

      out.write("\r\n");
      out.write("\t\t\t\t\t<option>all</option>\r\n");

					for(int i=0; i<materialsName.size(); i++){

      out.write("\r\n");
      out.write("\t\t\t\t\t\t<option>");
      out.print(materialsName.elementAt(i));
      out.write("</option>\r\n");

					}
				}

      out.write("\r\n");
      out.write("\t\t\t\t\r\n");
      out.write("\t\t\t</select>\r\n");
      out.write("\t\t\t<input type=\"hidden\" name=\"action\" value=\"query\">\r\n");
      out.write("\t\t\t<input type=\"submit\" value=\"提交\"style=\"height: 25px; width: 73px\">\r\n");
      out.write("\t</form>\r\n");
      out.write("\t</center>\r\n");
 
		if(dishes == null){
			
      out.write("<center><h2>没有你要查询的菜</h2></center>");

		}else{

      out.write("\r\n");
      out.write("\t\t\t<table border=\"1\" align=\"center\">\r\n");
      out.write("\t\t\t<caption align=\"center\" bgcolor=\"grean\">菜信息</caption>\r\n");
      out.write("\t\t\t\t<tr>\r\n");
      out.write("\t\t\t\t\t<th align=\"center\">菜ID</th><th align=\"center\">菜名</th>\r\n");
      out.write("\t\t\t\t\t<th align=\"center\">菜类</th><th align=\"center\">菜价</th>\r\n");
      out.write("\t\t\t\t\t<th align=\"center\" colspan=\"2\">操作</th>\r\n");
      out.write("\t\t\t\t</tr>\r\n");

			for(int i=0; i<dishes.size(); i++){
				Dish dish = (Dish)dishes.elementAt(i);

      out.write("\r\n");
      out.write("\t\t\t<tr>\r\n");
      out.write("\t\t\t\t<td align=\"center\">");
      out.print(dish.getDishID());
      out.write("</td>\r\n");
      out.write("\t\t\t\t<td align=\"center\">");
      out.print(dish.getDishName());
      out.write("</td>\r\n");
      out.write("\t\t\t\t<td align=\"center\">");
      out.print(dish.getType());
      out.write("</td>\r\n");
      out.write("\t\t\t\t<td align=\"center\">");
      out.print(dish.getPrice());
      out.write("</td>\r\n");
      out.write("\t\t\t\t<td align=\"center\"><a href=\"../servlet/DishController?action=modifyDishOK&dishID=");
      out.print(dish.getDishID());
      out.write("\">修改</a></td>\r\n");
      out.write("\t\t\t\t<td align=\"center\"><a href=\"../servlet/DishController?action=deleteDishOK&dishID=");
      out.print(dish.getDishID());
      out.write("\">删除</a></td>\r\n");
      out.write("\t\t\t</tr>\r\n");

			}

      out.write("\r\n");
      out.write("\t\t</table>\r\n");

		}

      out.write('\r');
      out.write('\n');
 
	}

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