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

📄 node_modify_do.jsp

📁 用JAVA实现的对动态树状信息的管理。操作员可以通过IE浏览器查看整个树形结构信息
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="com.socialite.bizlogic.util.CookieTool,
                 com.socialite.bizlogic.util.Char,
                 com.socialite.bizlogic.client.BizLogicClient,
                 com.socialite.bizlogic.util.XMLObject,
				 com.socialite.bizlogic.tree.TreeNodeObject,
				 com.socialite.bizlogic.tree.TreeObject,
				 com.socialite.bizlogic.tree.TreeIterator,
				 javax.swing.tree.DefaultTreeModel,
				 javax.swing.tree.DefaultMutableTreeNode"%>
<%
 // 如果操作员没有登录,则转到登录页面
    String op_id = com.socialite.bizlogic.util.CookieTool.getCookieValue(request.getCookies(),"op_id");
    if(op_id==null)
    {
        response.sendRedirect("/login/logout.jsp");
        return;
    }  else if (op_id.equalsIgnoreCase("-1") ){
        response.sendRedirect("/login/logout.jsp");
        return;
    }
	 request.setCharacterEncoding("gb2312");
	 
	 String node_id=request.getParameter("node_id");
	 String father_id=request.getParameter("father_id");
	 String name=request.getParameter("name");
	 String url=request.getParameter("url");

	if(father_id==null||node_id==null){
		response.sendRedirect("node_modify.jsp?id_error=1");
        return;
	}
	if(name==null||"".equals(name.trim())){
		response.sendRedirect("node_modify.jsp?id_error=2&node_id="+node_id);
        return;
	}
	StringBuffer xml=new StringBuffer("<bizlogic><logic_name>com.socialite.bizlogic.businesslogic.treemanagementlogic.TreeManagementBusinessLogic</logic_name>");
    xml.append(Char.LINE_SEPARATOR);
    xml.append("<requesttype>MODIFY_TREE_NODE</requesttype>");
    xml.append(Char.LINE_SEPARATOR);
    xml.append("<requestparameter>");
	xml.append("<node_id>" + node_id + "</node_id>" + Char.LINE_SEPARATOR);
	xml.append("<father_id>" + father_id + "</father_id>" + Char.LINE_SEPARATOR);
    xml.append("<name>" + name + "</name>" + Char.LINE_SEPARATOR);
	xml.append("<url>" + url + "</url>" + Char.LINE_SEPARATOR);
    xml.append("</requestparameter>");
    xml.append(Char.LINE_SEPARATOR);
    xml.append("</bizlogic>");
    xml.append(Char.LINE_SEPARATOR);

    BizLogicClient hc=new BizLogicClient();
    String xmlResult=hc.send(xml.toString());

    XMLObject xmlObj = new XMLObject(xmlResult,0);	
    String result=xmlObj.getValue("bizlogic.resultcode");

    if("0".equals(result)){
		//操作成功,更新application中的节点
		TreeObject tObject=null;
		TreeNodeObject newNode=null;
		
		tObject=(TreeObject)application.getAttribute("tree");
		newNode=new TreeNodeObject(node_id,father_id,name,url);
		tObject.modifyNode(newNode);
	} else if("-1001".equals(result))  {
        response.sendRedirect("node_modify.jsp?id_error=3&node_id="+node_id);
        return;
    }else   {
        response.sendRedirect("node_modify.jsp?id_error=4&node_id="+node_id);
        return;
    }
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>树型结构管理———修改节点</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="style.css" type="text/css">
<script language=javascript>
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td rowspan="3" width="30"></td>
    <td></td>
    <td rowspan="3" width="30"></td>
  </tr>
  <tr>
    <td>
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td colspan="5"></td>
        </tr>
        <tr>
          <td colspan="5" class="title" height="30"><br> 
          <b>修改节点成功<br>
            <br>
            </b></td>
        </tr>
        <tr>
          <td colspan="5" class="content" height="12">节点新信息 </td>
        </tr>
        <tr>
          <td colspan="5" background="images/bg_table1.gif" height="6"></td>
        </tr>
          <tr bgcolor="ACE3EB">
            <td height="24" width="16"> </td>
            <td height="24" colspan="4" bgcolor="ACE3EB" class="table_title">节点信息 </td>
          </tr>
          <tr bgcolor="5DC6D5">
            <td colspan="5" height="1"></td>
          </tr>
          <tr>
            <td height="24" width="16"> </td>
            <td class="content" height="24" width="92">节点编号</td>
            <td class="content" height="24" colspan="2">&nbsp;<%=node_id%>
            </td>
            <td height="24" class="content"></td>
          </tr>
          <tr bgcolor="5DC6D5">
            <td colspan="5" height="1"></td>
          </tr>
          <tr>
            <td height="24">&nbsp;</td>
            <td class="content" height="24">父亲节点编号</td>
            <td class="content" height="24" colspan="2">&nbsp;<%=father_id%></td>
            <td height="24" class="content"></td>
          </tr>
          <tr bgcolor="5DC6D5">
            <td colspan="5" height="1"></td>
          </tr>
          <tr>
            <td height="24">&nbsp;</td>
            <td class="content" height="24">节点名称</td>
            <td class="content" height="24" colspan="2">&nbsp;<%=name%></td>
            <td height="24" class="content"></td>
          </tr>
          <tr bgcolor="5DC6D5">
            <td colspan="5" height="1"></td>
          </tr>
		  <tr>
            <td height="24">&nbsp;</td>
            <td class="content" height="24">连接URL</td>
            <td class="content" height="24" colspan="2">&nbsp;<%=url%></td>
            <td height="24" class="content"></td>
          </tr>
          <tr bgcolor="5DC6D5">
            <td colspan="5" height="1"></td>
          </tr>
          <tr>
            <td colspan="5" background="images/bg_table2.gif" height="7"></td>
          </tr>
          <tr>
            <td colspan="5" height="20"></td>
          </tr>
          <tr>
            <td colspan="6" height="20" align="center">
              <a href="tree_show.jsp">返回首页</a></td>
          </tr>
      </table>
	</td></tr> </table>
</body>
</html>

⌨️ 快捷键说明

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