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

📄 addtype_jsp.java

📁 小型宠物医院网站
💻 JAVA
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import Bean.*;
import DB.*;
import java.util.*;

public final class addType_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=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("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<title>\r\n");
      out.write("addType</title>\r\n");
      out.write("<script type=\"\" language=\"javascript\">\r\n");
      out.write("function check(){\r\n");
      out.write(" var typename=document.form1.typename.value;\r\n");
      out.write(" var typemessage=document.form1.typemessage.value;\r\n");
      out.write(" if (typename=='') {\r\n");
      out.write("   alert(\"类别名称不能为空!\");\r\n");
      out.write("   return false;\r\n");
      out.write(" }\r\n");
      out.write(" if (typemessage=='') {\r\n");
      out.write("   alert(\"类别介绍不能为空!\");\r\n");
      out.write("   return false;\r\n");
      out.write(" }\r\n");
      out.write(" return true;\r\n");
      out.write("}\r\n");
      out.write("</script>\r\n");
      out.write("<style type=\"text/css\">\r\n");
      out.write("<!--\r\n");
      out.write("#Layer1 {\r\n");
      out.write("\tposition:absolute;\r\n");
      out.write("\twidth:200px;\r\n");
      out.write("\theight:115px;\r\n");
      out.write("\tz-index:-1;\r\n");
      out.write("\tleft: 12px;\r\n");
      out.write("\ttop: 17px;\r\n");
      out.write("}\r\n");
      out.write("#Layer2 {\r\n");
      out.write("\tposition:absolute;\r\n");
      out.write("\twidth:131px;\r\n");
      out.write("\theight:34px;\r\n");
      out.write("\tz-index:1;\r\n");
      out.write("\tleft: 35px;\r\n");
      out.write("\ttop: 27px;\r\n");
      out.write("\tbackground-color: #FFFFFF;\r\n");
      out.write("}\r\n");
      out.write(".STYLE1 {\r\n");
      out.write("\tfont-family: \"楷体_GB2312\";\r\n");
      out.write("\tfont-size: large;\r\n");
      out.write("}\r\n");
      out.write("-->\r\n");
      out.write("</style>\r\n");
      out.write("</head>\r\n");
      out.write("<body bgcolor=\"#ffffff\">\r\n");
      out.write("<table width=\"787\" height=\"404\" border=\"0\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td width=\"74\" height=\"27\">&nbsp;</td>\r\n");
      out.write("    <td width=\"614\">&nbsp;</td>\r\n");
      out.write("    <td width=\"85\">&nbsp;</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td height=\"293\">&nbsp;</td>\r\n");
      out.write("    <td align=\"center\"><form action=\"actionservlet\" method=\"POST\">\r\n");
      out.write("      现在已有的宠物类别有:<br />");

      DBConnect dbc=new DBConnect();
      ArrayList ar=dbc.getType();
      petTypeBean type;
      if (ar!=null&&(ar.size()>0)) {
        
      out.write("\r\n");
      out.write("        <select name=\"typeid\" >\r\n");
      out.write("        ");

        for (int i = 0; i <ar.size(); i++) {
          type=(petTypeBean)ar.get(i);
          
      out.write("\r\n");
      out.write("          <option value=\"");
      out.print(type.getTypeId());
      out.write('"');
      out.write('>');
      out.write(' ');
      out.print(type.getTypeName() );
      out.write("</option>\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("          ");
}
      out.write("\r\n");
      out.write("</select> <input type=\"submit\" value=\"删除\"/>\r\n");
      out.write("<input type=\"hidden\" name=\"action\"  value=\"deleteType\" />\r\n");
}
      out.write("</form>\r\n");
      out.write("注意: 点击以上图标会删除类别\r\n");
      out.write("<form name=\"form1\" onSubmit=\"return check()\" action=\"actionservlet\" method=\"POST\">\r\n");
      out.write("<table>\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td> 宠物类别名称:</td><td><input type=\"text\" name=\"typename\" /></td>\r\n");
      out.write("  </tr>\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td> 类别介绍:</td><td><textarea cols=\"20\" rows=\"3\" name=\"typemessage\"></textarea></td>\r\n");
      out.write("  </tr>\r\n");
      out.write("  <tr align=\"center\">\r\n");
      out.write("    <td><input type=\"submit\" value=\"添加\" /></td><td><input type=\"reset\"  value=\"重置\" /></td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\r\n");
      out.write("<input type=\"hidden\" name=\"action\" value=\"addType\" />\r\n");
      out.write("</form>\r\n");
      out.write("</td>\r\n");
      out.write("<td><div id=\"Layer1\"><img src=\"pet5/5.jpg\" width=\"740\" height=\"796\">\r\n");
      out.write("  <div id=\"Layer2\"><span class=\"STYLE1\">类别操作</span></div>\r\n");
      out.write("</div></td>\r\n");
      out.write("  </tr>\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td>&nbsp;</td>\r\n");
      out.write("    <td>&nbsp;</td>\r\n");
      out.write("    <td>&nbsp;</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\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 + -