code: private static InputStream render(final String folder,
          final InputStream template,
          final Map<String, Object> params) throws IOException {
          final ByteArrayOutputStream baos = new ByteArrayOutputStream();
          final Writer writer = new Utf8OutputStreamContent(baos);
          final VelocityEngine engine = new VelocityEngine();
          engine.setProperty(
              "file.resource.loader.path",
              folder
          );
          engine.evaluate(
              new VelocityContext(params),
              writer,
              "",
              new Utf8InputStreamContent(template)
          );
          writer.close();
          return new ByteArrayInputStream(baos.toByteArray());
      }
docs: Render it.
  @param folder Template folder
  @param template Page template
  @param params Params for velocity
  @return Page body
  @throws IOException If fails