struts2笔记之tree标签输出树

1、添加struts2-dojo-plugin-2.3.15.3.jar到web-inf/lib下

2、jsp文件

2.1、导入两个标签库

<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="sd" uri="/struts-dojo-tags"%>

2.2在jsp的head中加入属性:

<head>
....
<s:head theme="xhtml" />
<sd:head parseContent="true" />
</head>

2.3、添加tree

<sd:tree id="root" label="操作选项" showGrid="true" showRootGrid="true"
        toggle="explode" treeSelectedTopic="test">
        <sd:treenode id="child1" label="查看信息" />
        <sd:treenode id="child2" label="我的班级">
            <sd:treenode id="subchild1" label="共享信息" />
            <sd:treenode id="subchild2" label="班级公告" />
        </sd:treenode>
    </sd:tree>

done!

原文地址:https://www.cnblogs.com/xingyyy/p/3456475.html