test-recover.ftl

来自「一一个纯JAVA的解析工具,可以做所有可以的事情,而且对本站有非常大的帮助」· FTL 代码 · 共 30 行

FTL
30
字号
<#attempt>
 <#assign sequence = ["Hello, World"]>
 ${sequence[0]}
<#recover>
  We should never get here.
</#recover>
<#attempt>
 Let's try to output an undefined variable: ${undefined}
<#recover>
 Well, that did not work. Here is the error: ${.error}
 Now we nest another attempt/recover here:
 <#attempt>
   ${sequence[1]}
 <#recover>
   Oops: ${.error}
   Remember, freeMarker sequences are zero-based! ${sequence[0]}
 </#recover>
 Now we output the current error message: ${.error}
</#recover>
<#attempt>
  <#include "nonexistent_template">
<#recover>
  The template is not currently available
</#recover>
<#attempt>
  <#include "undefined.ftl">
<#recover>
  The included template has a problem: ${.error}
</#recover>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?