However, don't be under the impression that any visible Swing objects you use will magically appear in the user's browser. They won't. But if you want to build a tree as part of the inner workings of the servlet, then DefaultMutableTreeNode would be sufficient, I think; the only use of DefaultTreeModel would be as the model for a JTree, which would not have any point.