Java struts
答案:1 悬赏:70 手机版
解决时间 2021-11-26 12:26
- 提问者网友:轻浮
- 2021-11-26 04:42
Java struts
最佳答案
- 五星知识达人网友:从此江山别
- 2021-11-26 06:11
public void initTree(Tree tree, String dicname, String prentId) {
String hsql = " from DicPublist where dicname= '" + dicname + "' ";
if (prentId != null && !prentId.equals("")) {
hsql += " and remark='" + prentId + "'";
}
List list = new ArrayList();
list = (List) netInfoDAO.select(hsql);
if (list != null && list.size() > 0) {
Tree temArray[] = new Tree[list.size()];
for (int i = 0; i < list.size(); i++) {
DicPublist temp = list.get(i);
Tree tempTree = new Tree();
tempTree.setDisplayName(temp.getValue());
tempTree.setId(temp.getListno());
tempTree.setParentId(temp.getRemark());
tempTree.setChildren(null);
temArray[i] = tempTree;
initTree(tempTree, dicname, temp.getListno());
}
tree.setChildren(temArray);
}
}
String hsql = " from DicPublist where dicname= '" + dicname + "' ";
if (prentId != null && !prentId.equals("")) {
hsql += " and remark='" + prentId + "'";
}
List
list = (List
if (list != null && list.size() > 0) {
Tree temArray[] = new Tree[list.size()];
for (int i = 0; i < list.size(); i++) {
DicPublist temp = list.get(i);
Tree tempTree = new Tree();
tempTree.setDisplayName(temp.getValue());
tempTree.setId(temp.getListno());
tempTree.setParentId(temp.getRemark());
tempTree.setChildren(null);
temArray[i] = tempTree;
initTree(tempTree, dicname, temp.getListno());
}
tree.setChildren(temArray);
}
}
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯