code: public String renderToString(String templateName, Map<String, Object> model) {
          if (templateEngine == null) {
              throw new PippoRuntimeException("You must set a template engine in your application");
          }
  
          // merge the model passed with the locals data
          model.putAll(getLocals());
  
          // add session (if exists) to model
          Session session = Session.get();
          if (session != null) {
              model.put("session", session);
          }
  
          // render the template using the merged model
          StringWriter stringWriter = new StringWriter();
          templateEngine.renderResource(templateName, model, stringWriter);
  
          return stringWriter.toString();
      }
docs: Renders a template to a {@link String}.
  
  @param templateName
  @param model