Answer the question
In order to leave comments, you need to log in
How to build a folder tree?
I want to build a tree from the file system from www.ztree.me/v3/api.php. Tell me how to organize this in spring mvc.
Answer the question
In order to leave comments, you need to log in
You need to write a controller that takes a path in the file system as a parameter, for example:
D:/
D:/Music/
D:/Music/Classic/
etc.
In the controller, you get a list of subdirectories and files along this path and return it as json. As in the zTree examples:
[
{name: "pNode 01", children: [
{name: "child 01"},
{name: "child 02"}
]}
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question