//fb.setApprovedThreads();
//fb.setThreads(forum.getThreadCount());
//fb.setMessages(forum.getMessageCount());
request.setAttribute("fb", fb);
ForumThread thread = forum.getThread(Integer.parseInt(request.getParameter("threadID")));
ThreadBean tb = new ThreadBean();
tb.setId(thread.getID());
tb.setForumID(forum.getID());
tb.setCreationDate(thread.getCreationDate());
tb.setModifiedDate(thread.getModifiedDate());
tb.setApproved(thread.isApproved());
tb.setNotApprovedMessages(thread.getMessageCount(false));
tb.setMessages(thread.getMessageCount());
tb.setReplies(thread.getMessageCount() - 1);
tb.setTopic(thread.getName());
TreeWalker walker = thread.treeWalker();
Message rootMessage = walker.getRoot();
populate(walker,tb,rootMessage,0);