jsp代码
<script language= "javascript ">
var nodes = new Array();
nodes[0] = new Node(1, 'zzzzz ', ' ', ' ',0, 'true ');
<%
List nodelist = (List)request.getAttribute( "nodes ");
//session.removeAttribute( "tree_folder ");
int index = 1;
Iterator roomIt = nodelist.iterator();
while(roomIt.hasNext()){
Node room = (Node)roomIt.next();
int parent = index;
out.println( "nodes[ "+index+ "] = new Node( "+(index + 1) + ", ' "+room.getName()+ " ', ' "+room.getPath()+ " ', ' ',0, 'true '); ");
index++;
java.util.Iterator casesIt = room.getChildren().iterator();
while(casesIt.hasNext()){
Node cases = (Node)casesIt.next();
out.println( "nodes[ "+index+ "] = new Node( "+(index + 1)+ ", ' "+cases.getName()+ " ', ' "+cases.getPath()+ " ', ' ', "+parent+ ", 'false '); ");