I have a Java function, say method1(), which throws an exception upon some condition, say condition A. I'm calling that function from my FTL file with condition A met. Now I'm getting a template error in FTL saying above function threw an exception. Just like we handle exceptions in Java with try-catch, I want something similar in my FTL.
This is something similar to my FTL code.
<#-- @ftlvariable name="someUtilClass" type="com.some.package.SomeUtilClass" -->
<#attempt>
<#assign x = someUtilClass.method1() />
<#recover>
<#assign x = '' />
</#recover>
I'm using Freemarker 2.3.20.
Thanks.