📄 node_delete.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;
}
if(op_id==null||false)//check privilege here
{
response.sendRedirect("/login/logout.jsp");
return;
}
request.setCharacterEncoding("gb2312");
String node_id=request.getParameter("node_id");
if(node_id==null){
response.sendRedirect("tree_show.jsp");
return;
}
StringBuffer xml=new StringBuffer("<bizlogic><logic_name>com.socialite.bizlogic.businesslogic.treemanagementlogic.TreeManagementBusinessLogic</logic_name>");
xml.append(Char.LINE_SEPARATOR);
xml.append("<requesttype>DELETE_TREE_NODE</requesttype>");
xml.append(Char.LINE_SEPARATOR);
xml.append("<requestparameter>");
xml.append("<node_id>" + node_id + "</node_id>" + 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 node=null;
tObject=(TreeObject)application.getAttribute("tree");
//得到节点信息
DefaultMutableTreeNode dfNode=tObject.getNode(node_id);
node=(TreeNodeObject)dfNode.getUserObject();
tObject.deleteNode(node);
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>树型节点管理——删除节点</title>
</head>
<body>
<table width="916" height="351" border="0.2">
<%
if("0".equals(result)){
%>
<tr>
<td height="169"><div align="center">
<p>您的操作成功</p>
<p>请<a href="tree_show.jsp">返回主页</a></p>
</div></td>
</tr>
<%
}else{
%>
<tr>
<td><div align="center">操作失败,请<a href="tree_show.jsp">重试</a></div></td>
</tr>
<%
}
%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -