小弟想做个设置权限的tree,权限由数据库导出,选中后直接倒入数据库,但是不知道如何传值,斑竹大哥们帮帮忙啊!以下是小弟的从数据库倒出tree的程序
<%@ page contentType="text/html; charset=GBK" import="java.lang.String"%>
<jsp:useBean id="db" scope="page" class="system.dbconnection"/>
<%@ page import="java.sql.*"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<script src="alai_win_xp.js"></script>
<script src="alai_tree.js"></script>
<script src="alai_tree_pretty.js"></script>
<script src="alai_tree_check.js"></script>
</head>
<body>
<p> </p>
<div id="divTree1"></div>
<p align="center"> </p>
<script>
var tree1=new alai_tree_pretty(divTree1)
var root=tree1.root
<%
String str[]=new String[6];
int i=0;
ResultSet result;
Statement stmt=null;
String sql="select * from qx";
Connection con=db.getConnection();
stmt=con.createStatement();
result=stmt.executeQuery(sql);
while(result.next())
{
if(result.getString("flag").equals("add")){
str[i]="var "+result.getString("code")+"="+result.getString("parcode")+"."+result.getString("flag")+"(\""+result.getString("name")+"\")";
i++;
}
else{
str[i]="tree1.addChkNode("+result.getString("parcode")+",\""+result.getString("name")+"\")";
i++;
}
}
for(int n=0 ; n < str.length ; n++)
{
out.println(str[n]);
}
%>
tree1.oncheck=function(srcNode)
{
if(srcNode.checkBox.checked) //添加
{
var item=document.createElement("option")
item.text=item.value=srcNode.label.innerText
}else //取消
{
for(var i=0;i<sltName.options.length;i++)
{
if(srcNode.label.innerText==sltName.options[i].value)sltName.options[i]=null;
}
}
}
n11.checkBox.checked=n12.checkBox.checked=n13.checkBox.checked=true
/*程序代码浏览窗口*/
var script=document.getElementsByTagName("SCRIPT")
var sCode=script[4].innerHTML
sCode=sCode.replace(/</g,"<").replace(/>/g,">")
sCode=sCode.replace(/([A-Za-z0-9><_\)\(\]\[\}\{\. \$/;=\+\?"&:-]{2,})/g,"<font color='green'>$1</font>");
sCode=sCode.replace(/\t/g," ")
sCode=sCode.replace(/(\/\*)/g,"<font color='maroon'>$1")
sCode=sCode.replace(/(\*\/)/g,"$1</font>")
sCode=sCode.replace(/\n/g,"<br>")
winCode=new alai_win_xp(sCode,"程序代码浏览窗口",600,500,45,120)
winCode.addButton("隐藏","hide")
winCode.content.style.cssText="text-align:left;color:darkblue;background-color:#dddddd"
/* The End */
</script>
</body>
</html>
<SCRIPT src=\"alai_win_xp.js\">