@Advice.OnMethodEnter(inline = false) public static void onBeforeEvaluate(@Advice.Argument(0) Environment env, @Advice.This Expression dot) { Profiler.start(env.getCurrentTemplate().getName() + ':' + dot.getBeginLine() + '#' + dot.toString()); }
>= _TemplateAPI.VERSION_INT_2_3_26 ? env.getCurrentTemplate() : env.getTemplate();
absTemplateName = env.toFullTemplateName(env.getCurrentTemplate().getName(), templateName); } catch (MalformedTemplateNameException e) { throw new _TemplateModelException(
@Override public void handleTemplateException(TemplateException templateexception, Environment environment, Writer writer) throws TemplateException { try { String code = templateexception.getFTLInstructionStack(); if (null != code && code.indexOf("Failed at: ") > 0 && code.indexOf(" [") > 0) { writer.write("error:" + code.substring(code.indexOf("Failed at: ") + 11, code.indexOf(" ["))); } else { writer.write("[some errors occurred!]"); } } catch (IOException e) { log.error(environment.getCurrentTemplate().getSourceName(), e); } }
@Override public void handleTemplateException(TemplateException templateexception, Environment environment, Writer writer) throws TemplateException { try { String code = templateexception.getFTLInstructionStack(); if (null != code && code.indexOf("Failed at: ") > 0 && code.indexOf(" [") > 0) { writer.write("error:" + code.substring(code.indexOf("Failed at: ") + 11, code.indexOf(" ["))); } else { writer.write("[some errors occurred!]"); } } catch (IOException e) { log.error(environment.getCurrentTemplate().getSourceName(), e); } }
return SimpleScalar.newInstanceOrNull(env.getCurrentTemplate().getName());
@Override public void handleTemplateException(TemplateException templateexception, Environment environment, Writer writer) throws TemplateException { try { String code = templateexception.getFTLInstructionStack(); if (null != code && code.indexOf("Failed at: ") > 0 && code.indexOf(" [") > 0) { String xx = code.substring(code.indexOf("Failed at: ") + 11, code.indexOf(" [")); writer.write(xx); // log.error("freemarker error :{}", xx); } else { writer.write("[some errors occurred!]"); } } catch (IOException e) { log.error(environment.getCurrentTemplate().getSourceName(), e); } }
@Advice.OnMethodEnter(inline = false) public static void onBeforeEvaluate(@Advice.Argument(0) Environment env, @Advice.This Expression dot) { Profiler.start(env.getCurrentTemplate().getName() + ':' + dot.getBeginLine() + '#' + dot.toString()); }
>= _TemplateAPI.VERSION_INT_2_3_26 ? env.getCurrentTemplate() : env.getTemplate();
>= _TemplateAPI.VERSION_INT_2_3_26 ? env.getCurrentTemplate() : env.getTemplate();
absTemplateName = env.toFullTemplateName(env.getCurrentTemplate().getName(), templateName); } catch (MalformedTemplateNameException e) { throw new _TemplateModelException(
absTemplateName = env.toFullTemplateName(env.getCurrentTemplate().getName(), templateName); } catch (MalformedTemplateNameException e) { throw new _TemplateModelException(
return SimpleScalar.newInstanceOrNull(env.getCurrentTemplate().getName());
return SimpleScalar.newInstanceOrNull(env.getCurrentTemplate().getName());