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

📄 addproduct_jsp.java

📁 基于WEB的商品管理系统
💻 JAVA
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.me.product.*;
import java.util.*;
import java.io.*;

public final class addProduct_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.List _jspx_dependants;

  public Object 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,
      			"error.jsp", true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write('\n');
      out.write('\n');
      out.write('\n');
      out.write("\n");
      out.write("\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n");
      out.write("   \"http://www.w3.org/TR/html4/loose.dtd\">\n");
      out.write("\n");
      out.write("<html>\n");
      out.write("<head>\n");
      out.write("<title>Untitled Document</title>\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\n");
      out.write("</head>\n");
      org.me.product.ViewCategory category = null;
      synchronized (_jspx_page_context) {
        category = (org.me.product.ViewCategory) _jspx_page_context.getAttribute("category", PageContext.PAGE_SCOPE);
        if (category == null){
          category = new org.me.product.ViewCategory();
          _jspx_page_context.setAttribute("category", category, PageContext.PAGE_SCOPE);
          out.write('\n');
          org.apache.jasper.runtime.JspRuntimeLibrary.introspect(_jspx_page_context.findAttribute("category"), request);
          out.write('\n');
        }
      }
      out.write("\n");
      out.write("<body>\n");
      out.write("<script language=\"JavaScript\">\n");
      out.write("<!--\n");
      out.write("function RgTest()\n");
      out.write("{ \n");
      out.write("   if(document.product.productId.value==\"\")\n");
      out.write("     {\n");
      out.write("\t   window.alert(\"Please input all the information\");\n");
      out.write("\t   document.product.productId.focus();\n");
      out.write("\t   return false;\n");
      out.write("\t}\n");
      out.write("\tif(document.product.name.value==\"\")\n");
      out.write("     {\n");
      out.write("\t   window.alert(\"Please input all the information!\");\n");
      out.write("\t   document.product.name.focus();\n");
      out.write("\t   return false;\n");
      out.write("\t}\n");
      out.write("\tif(document.product.price.value==\"\")\n");
      out.write("     {\n");
      out.write("\t   window.alert(\"Please input all the informatio!\");\n");
      out.write("\t   document.product.price.focus();\n");
      out.write("\t   return false;\n");
      out.write("\t}if(document.product.producer.value==\"\")\n");
      out.write("     {\n");
      out.write("\t   window.alert(\"Please input all the information!\");\n");
      out.write("\t   document.product.producer.focus();\n");
      out.write("\t   return false;\n");
      out.write("\t}\n");
      out.write("\tif(document.product.description.value==\"\")\n");
      out.write("     {\n");
      out.write("\t   window.alert(\"Please input all the information!\");\n");
      out.write("\t   document.product.description.focus();\n");
      out.write("\t   return false;\n");
      out.write("\t}\n");
      out.write("\t   \n");
      out.write("\t   \n");
      out.write("\t   return true;\n");
      out.write("}\n");
      out.write("//-->\n");
      out.write("</script>\n");
      out.write("\n");
      out.write("\t   \n");
      out.write("<center>\n");
      out.write("<h1>add product</h1>\n");
      out.write("<form action=\"addProduct_do.jsp\" method=\"post\" name=\"product\">\n");
      out.write("<table border=\"1\" bgcolor=\"#0099CC\">\n");
      out.write("<tr><td>productId:<input type=\"text\" name=\"productId\"></td></tr>\n");
      out.write("<tr><td>name:<input type=\"text\" name=\"name\"></td></tr>\n");
      out.write("<tr><td>price:<input type=\"text\" name=\"price\"></td></tr>\n");
      out.write("<tr><td>=producer=:<input type=\"text\" name=\"producer\"></td></tr>\n");
      out.write("<tr><td>=description=:<input type=\"text\" name=\"description\"></td></tr>\n");
      out.write("<tr><td>=categoryId=:<select name=\"categoryId\">\n");
 Collection categorys=category.getAllCategory();Iterator it=categorys.iterator();while(it.hasNext()){    Category temp=(Category)it.next();	out.println("<option value="+temp.getCategoryId()+">"+temp.getCategoryId()+"</option>");}
      out.write("\n");
      out.write("</select></td></tr>\n");
      out.write("<tr><td><input type=submit value=OK  onClick=\"return RgTest()\"></td></tr>\n");
      out.write("</table>\n");
      out.write("</form>\n");
      out.write("</center>\n");
      out.write("</body>\n");
      out.write("</html>\n");
      out.write("\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 + -