/**
   * render parameters to the prescribed template and return the RenderResult
   *
   * @param template relative path from japidviews folder. if empty, use implicit naming pattern to
   *     match the template
   * @param args
   */
  public static String getRenderResultWith(String template, Object... args) {
    checkJapidInit();

    if (template == null || template.length() == 0) {
      template = template();
    }

    if (template.endsWith(HTML)) {
      template = template.substring(0, template.length() - HTML.length());
    }

    String templateClassName =
        template.startsWith(JAPIDVIEWS_ROOT)
            ? template
            : JAPIDVIEWS_ROOT + File.separator + template;

    templateClassName = templateClassName.replace('/', DOT).replace('\\', DOT);

    Class<? extends JapidTemplateBaseWithoutPlay> tClass = null;

    // tClass = JapidRenderer.getClass(templateClassName);
    //
    // if (tClass == null) {
    // String templateFileName = templateClassName.replace(DOT, '/') + HTML;
    // throw new
    // RuntimeException("Could not find a Japid template with the name of: "
    // + templateFileName);
    // } else {
    // // render(tClass, args);
    // String rr = invokeRender(tClass, args);
    // return rr;
    // }
    RendererClass rc = JapidRenderer.getFunctionalRendererClass(templateClassName);
    if (rc == null) {
      String templateFileName = templateClassName.replace(DOT, '/') + HTML;
      throw new RuntimeException(
          "Could not find a Japid template with the name of: " + templateFileName);
    } else {
      String rr = invokeRender(rc, args);
      return rr;
    }
  }