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

📄 tree_jsp.java

📁 vb+java实现的图书管理系统
💻 JAVA
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

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

  private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

  private static java.util.List _jspx_dependants;

  private javax.el.ExpressionFactory _el_expressionfactory;
  private org.apache.AnnotationProcessor _jsp_annotationprocessor;

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
  }

  public void _jspDestroy() {
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    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 {
      response.setContentType("text/html; charset=UTF-8");
      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');
      out.write('\n');

    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";

      out.write("\r\n");
      out.write("\r\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");
      out.write("<html>\r\n");
      out.write("\t<head>\r\n");
      out.write("\t\t<base href=\"");
      out.print(basePath);
      out.write("\">\r\n");
      out.write("\r\n");
      out.write("\t\t<title>My JSP 'index.jsp' starting page</title>\r\n");
      out.write("\t\t<link rel=\"stylesheet\" type=\"text/css\"\r\n");
      out.write("\t\t\thref=\"ext/resources/css/ext-all.css\" />\r\n");
      out.write("\t\t<link rel=\"stylesheet\" type=\"text/css\"\r\n");
      out.write("\t\t\thref=\"ext/resources/css/xtheme-gray.css\" />\r\n");
      out.write("\t\t<link rel=\"stylesheet\" type=\"text/css\"\r\n");
      out.write("\t\t\thref=\"ext/resources/css/xtheme-gray-extend\" id=\"theme\" />\r\n");
      out.write("\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/ext-patch.css\" />\r\n");
      out.write("\t\t<script type=\"text/javascript\" src=\"ext/ext-base.js\"></script>\r\n");
      out.write("\t\t<script type=\"text/javascript\" src=\"ext/ext-all.js\"></script>\r\n");
      out.write("\t\t<script type=\"text/javascript\" src=\"ext/ext-lang-zh_CN.js\"></script>\r\n");
      out.write("\t\t<style type=\"text/css\">\r\n");
      out.write("\t\t  .x-tree-node-leaf .x-tree-node-icon{\r\n");
      out.write("\t           background-image:url(images/icons/tux.png);\r\n");
      out.write("           }\r\n");
      out.write("           .menu-item-delete{\r\n");
      out.write("\t           background-image:url(images/icons/delete.png) !important;\r\n");
      out.write("           }\r\n");
      out.write("        </style>\r\n");
      out.write("\r\n");
      out.write("\t\t<script type=\"text/javascript\">\r\n");
      out.write("\t    Ext.onReady(function(){\r\n");
      out.write("\t    \r\n");
      out.write("\t    \r\n");
      out.write("\t//definatiion for right menu\r\n");
      out.write("    var rightMenu = new Ext.menu.Menu({\r\n");
      out.write("\t     items: [\r\n");
      out.write("\t         {id: \"add\", text: \"新增子类\", icon: \"images/icons/add.gif\"},\r\n");
      out.write("\t         {id: \"rename\", text: \"重命名\", icon: \"images/icons/edit.png\"},\r\n");
      out.write("\t         {id: \"delete\", text: \"删除\", icon: \"images/icons/delete.gif\"}\r\n");
      out.write("\t     ]\r\n");
      out.write("\t });\r\n");
      out.write("\t \r\n");
      out.write("    // defination for tree\r\n");
      out.write("    var tree = new Ext.tree.TreePanel({\r\n");
      out.write("        el:'tree-div',\r\n");
      out.write("        useArrows:true,\r\n");
      out.write("        autoScroll:true,\r\n");
      out.write("        animate:true,\r\n");
      out.write("        lines: false,\r\n");
      out.write("        enableDD:true,\r\n");
      out.write("        containerScroll: true,\r\n");
      out.write("        pathSeparator: \"\",\r\n");
      out.write("        loader: new Ext.tree.TreeLoader({\r\n");
      out.write("            dataUrl:'categoryAction.action'\r\n");
      out.write("        }),\r\n");
      out.write("        listeners: {\"contextmenu\": function(node, evt){\r\n");
      out.write("            rightMenu.showAt(evt.getXY());\r\n");
      out.write("            Ext.getCmp(\"add\").addListener(\"click\", function(){\r\n");
      out.write("                Ext.MessageBox.show({\r\n");
      out.write("                    title: \"新增产品子类别\",\r\n");
      out.write("                    msg: \"请输入要增加的子类的名称:\",\r\n");
      out.write("                    prompt: true,\r\n");
      out.write("                    width: 400,\r\n");
      out.write("                    buttons: Ext.MessageBox.OKCANCEL,\r\n");
      out.write("                    fn: function(btn, text){\r\n");
      out.write("                        if(btn == \"ok\"){\r\n");
      out.write("                            if(text != null && text != \"\"){\r\n");
      out.write("                                if(node.leaf == true){node.leaf = false;}\r\n");
      out.write("                                var child = new Ext.tree.AsyncTreeNode({\r\n");
      out.write("                                    text: text,\r\n");
      out.write("                                    leaf: false,\r\n");
      out.write("                                    id: \"\"\r\n");
      out.write("                                });\r\n");
      out.write("                                node.appendChild(child);\r\n");
      out.write("                                var category = {\r\n");
      out.write("                                    text: child.text,\r\n");
      out.write("                                    leaf: child.leaf,\r\n");
      out.write("                                    parentId: node.id\r\n");
      out.write("                                }\r\n");
      out.write("                                var categoryJson = {categoryString: Ext.encode(category)};\r\n");
      out.write("                                Ext.Ajax.request({\r\n");
      out.write("                                    url: \"categoryAction.action?operation=add\",\r\n");
      out.write("                                    method: \"POST\",\r\n");
      out.write("                                    params: categoryJson,\r\n");
      out.write("                                    success: function(){window.alert(\"add successfully\")},\r\n");
      out.write("                                    failure: function(){window.alert(\"add failed\")}\r\n");
      out.write("                                });\r\n");
      out.write("                            }else{\r\n");
      out.write("                                Ext.MessageBox.alert(\"温馨提示\", \"子类名称不能为空\");\r\n");
      out.write("                            }\r\n");
      out.write("                        }\r\n");
      out.write("                    }\r\n");
      out.write("                });\r\n");
      out.write("            });//end add listener to add on click\r\n");
      out.write("            \r\n");
      out.write("            Ext.getCmp(\"rename\").addListener(\"click\", function(){\r\n");
      out.write("                Ext.MessageBox.show({\r\n");
      out.write("                    title: \"重命名产品子类别\",\r\n");
      out.write("                    msg: \"请输入新的产品子类别名称:\",\r\n");
      out.write("                    width: 400,\r\n");
      out.write("                    prompt: true,\r\n");
      out.write("                    value: node.text,\r\n");
      out.write("                    buttons: Ext.MessageBox.OKCANCEL,\r\n");
      out.write("                    fn: function(btn, text){\r\n");
      out.write("                        if(btn == \"ok\"){\r\n");
      out.write("                            if(text != null && text != \"\"){\r\n");
      out.write("                                node.setText(text);\r\n");
      out.write("                                var category = {\r\n");
      out.write("                                    id: node.id,\r\n");
      out.write("                                    text: node.text\r\n");
      out.write("                                }\r\n");
      out.write("                                var categoryJson = {categoryString: Ext.encode(category)};\r\n");
      out.write("                                Ext.Ajax.request({\r\n");
      out.write("                                    url: \"categoryAction.action?operation=update\",\r\n");
      out.write("                                    method: \"POST\",\r\n");
      out.write("                                    params: categoryJson,\r\n");
      out.write("                                    success: function(){window.alert(\"update successfully\")},\r\n");
      out.write("                                    failure: function(){window.alert(\"update failed\")}\r\n");
      out.write("                                });\r\n");
      out.write("                            }else{\r\n");
      out.write("                                Ext.MessageBox.alert(\"温馨提示\", \"子类名称不能为空\");\r\n");
      out.write("                            }\r\n");
      out.write("                        }\r\n");
      out.write("                    }\r\n");
      out.write("                    \r\n");
      out.write("                });\r\n");
      out.write("            });//end add listener to rename on click\r\n");
      out.write("            \r\n");
      out.write("            \r\n");
      out.write("            \r\n");
      out.write("            Ext.getCmp(\"delete\").addListener(\"click\", function(){\r\n");
      out.write("                Ext.MessageBox.show({\r\n");
      out.write("                    title: \"删除产品子类别\",\r\n");
      out.write("                    msg: \"你确定要删除该产品子类别么?\",\r\n");
      out.write("                    buttons: Ext.MessageBox.OKCANCEL,\r\n");
      out.write("                    fn: function(btn, text){\r\n");
      out.write("                        if(btn == \"ok\"){\r\n");
      out.write("                            Ext.Ajax.request({\r\n");
      out.write("                                url: \"categoryAction.action?operation=delete&nodeId=\"+node.id,\r\n");
      out.write("                                success: function(){\r\n");
      out.write("                                    window.alert(\"delete successfully\");\r\n");
      out.write("                                    node.remove();\r\n");
      out.write("                                },\r\n");
      out.write("                                failure: function(){window.alert(\"delete failed\")}\r\n");
      out.write("                            });\r\n");
      out.write("                        }\r\n");
      out.write("                    }\r\n");
      out.write("                    \r\n");
      out.write("                });\r\n");
      out.write("            });//end add listener to delete on click\r\n");
      out.write("            \r\n");
      out.write("            \r\n");
      out.write("        }, \"movenode\": function(tree,node,oldParentNode,newParentNode,index){\r\n");
      out.write("            if(node.leaf == true) node.leaf = false;\r\n");
      out.write("            Ext.Ajax.request({\r\n");
      out.write("                url: \"categoryAction.action?operation=dnd&nodeId=\"+node.id+\"&parentId=\"+newParentNode.id,\r\n");
      out.write("                method: \"POST\",\r\n");
      out.write("                success: function(){window.alert(\"move successfully\")},\r\n");
      out.write("                failure: function(){window.alert(\"move failed\")}\r\n");
      out.write("            });\r\n");
      out.write("        }\r\n");
      out.write("        }\r\n");
      out.write("    });\r\n");
      out.write("\r\n");
      out.write("    // set the root node\r\n");
      out.write("    var root = new Ext.tree.AsyncTreeNode({\r\n");
      out.write("        text: '产品类别总览',\r\n");
      out.write("        inputType: \"textfield\",\r\n");
      out.write("        draggable:false,\r\n");
      out.write("        id:'0'\r\n");
      out.write("    });\r\n");
      out.write("    tree.setRootNode(root);\r\n");
      out.write("\r\n");
      out.write("    // render the tree\r\n");
      out.write("    tree.render();\r\n");
      out.write("    root.expand();\r\n");
      out.write("});\r\n");
      out.write("\t    </script>\r\n");
      out.write("\r\n");
      out.write("\t</head>\r\n");
      out.write("\r\n");
      out.write("\t<body>\r\n");
      out.write("\t\t<div id=\"tree-div\"\r\n");
      out.write("\t\t\tstyle=\"overflow: auto; height: 300px; width: 250px; border: 1px solid #c3daf9;\"></div>\r\n");
      out.write("\t</body>\r\n");
      out.write("</html>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try { out.clearBuffer(); } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -