Allow TemplateRenderer to write to writers

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Fixed
    • None
    • Component/s: API
    • None
    • 0

      The TemplateRenderer in bamboo-api only renders templates into Strings, which it returns. This means that the output of every template it renders gets buffered twice, firstly in the StringWriter it writes to, and then in the String that the StringWriter creates when the toString() method is called. If the user of the TemplateRenderer has a writer (for example, the HttpServletResponse), this buffering is totally unnecessary and will inhibit performance and cause each request to use more memory. It would be much better if a method was added to TemplateRenderer that accepted a Writer for it to write to, for example:

      void renderPage(String path, Map params, Writer writer) throws IOException;
      

              Assignee:
              Unassigned
              Reporter:
              James Roper [Atlassian]
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: