用于嵌套树结构的 Java JSP 自定义标记。
我想为树结构创建自定义 Java JSP 标记,例如:
<ul>
<li>
<a href="#">Root</a>
<ul>
<li><a href="#">Node</a></li>
<li><a href="#">Node</a></li>
<li><a href="#">Node</a></li>
<li>
<a href="#">Node</a>
<ul>
<li><a href="#">Node</a></li>
<li><a href="#">Node</a></li>
</ul>
</li>
</ul>
</li>
</ul>
在 JSP 文件中,XML 应该如下所示:
<lib:treeview>
<lib:treenode path="/some/path.do" label="Root">
<lib:treenode path="/some/path.do" label="NodeLabel"/>
<lib:treenode path="/some/path.do" label="NodeLabel"/>
<lib:treenode path="/some/path.do" label="NodeLabel"/>
</lib:node>
</lib:treeview>
有人实现了像这样的嵌套结构吗?哪些类比较好用?也许有人有一些有用的链接?请帮忙:)
I want to create my custom Java JSP tags for tree structure such as:
<ul>
<li>
<a href="#">Root</a>
<ul>
<li><a href="#">Node</a></li>
<li><a href="#">Node</a></li>
<li><a href="#">Node</a></li>
<li>
<a href="#">Node</a>
<ul>
<li><a href="#">Node</a></li>
<li><a href="#">Node</a></li>
</ul>
</li>
</ul>
</li>
</ul>
In JSP file an XML should looks like:
<lib:treeview>
<lib:treenode path="/some/path.do" label="Root">
<lib:treenode path="/some/path.do" label="NodeLabel"/>
<lib:treenode path="/some/path.do" label="NodeLabel"/>
<lib:treenode path="/some/path.do" label="NodeLabel"/>
</lib:node>
</lib:treeview>
Did somebody implement nested structures like this one? What classes are better to use? Maybe somebody has some useful links? Help, please :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
还没有测试过这个,类似这样的东西应该可以工作:
treeview.tag:
treenode.tag:
test.jsp:
输出:
Haven't tested this, something like this should work:
treeview.tag:
treenode.tag:
test.jsp:
output:
这棵 JSP 树很简单。你可以增强。它也有复选框。完整的源代码和自述文件将指导您。这是我在空闲时间写的。再见
http://sourceforge.net/projects/jsptree-simple/
This JSP tree is simple one. You can enhance. It has checkboxes as well. The complete source code and Read Me file will guide you. I have wrote this in my free time. Bye
http://sourceforge.net/projects/jsptree-simple/