protected void asHtml(Writer writer, String resourceName, Map<String, Object> startingParams) {
   if (TextUtils.stringSet(resourceName)) {
     try {
       templatingEngine.render(file(resourceName)).applying(startingParams).asHtml(writer);
     } catch (IOException e) {
       log.error("Error while rendering velocity template for '" + resourceName + "'.", e);
     }
   }
 }
 protected String getHtml(String resourceName, Map<String, Object> startingParams) {
   if (TextUtils.stringSet(resourceName)) {
     try {
       return templatingEngine.render(file(resourceName)).applying(startingParams).asHtml();
     } catch (VelocityException e) {
       log.error("Error while rendering velocity template for '" + resourceName + "'.", e);
     }
   }
   return "";
 }