Printing a tree structure in a JSP page

I'm trying to print a tree structure on my JSP page that looks something like this:

Root
 |
 |----Dependencies
 |        |----A
 |        |----B
 |        |----C
 |
 |----Dependents
          |----D
          |----E

I hope someone here knows some usefulness that will help me do my job (she can use any technology as long as I can insert it into my JSP page). The root and other variables are all strings (A, B, C, etc.).

I plan on using something like this: (I haven't written this yet, so I'm not sure if this will work ...)

public class DependencyTree 
{ 
  private String root; 
  private ArrayList<String> dependencies, dependents; 
} 

Basically, root corresponds to “root” in my example above, and two ArrayLists contain A, B, C and D, E respectively.

+3
source share

Source: https://habr.com/ru/post/1760205/


All Articles