code: public static void appendQueryPageComments(RequestContext requestContext, QueryPage queryPage) {
      QueryQuestionCommentDAO queryQuestionCommentDAO = new QueryQuestionCommentDAO();
      PanelStamp activeStamp = RequestUtils.getActiveStamp(requestContext);
      List<QueryQuestionComment> rootComments = queryQuestionCommentDAO.listRootCommentsByQueryPageAndStampOrderByCreated(queryPage, activeStamp);
      Map<Long, List<QueryQuestionComment>> childComments = queryQuestionCommentDAO.listTreesByQueryPageAndStampOrderByCreated(queryPage, activeStamp);
  
      QueryUtils.appendQueryPageRootComments(requestContext, queryPage.getId(), rootComments);
      QueryUtils.appendQueryPageChildComments(requestContext, childComments);
      
      int commentCount = rootComments.size();
      
      for (Object key : childComments.keySet()) {
        List<QueryQuestionComment> childCommentList = childComments.get(key);
        if (childCommentList != null)
          commentCount += childCommentList.size();
      }
      
      requestContext.getRequest().setAttribute("queryPageCommentCount", commentCount);
    }
docs: Loads the whole comment tree and appends it to requestContext for JSP to read.
  
  @param requestContext Smvcj request context
  @param queryPage query page