Since you're asking about the display of JSP,
you should know that you are asking about HTML. That's because a JSP is a tool for generating HTML.
So find the answer to how to get a tree display in HTML, and then write a JSP which generates that HTML. And remember that you can use Javascript in your HTML.