执行信息

  • #execInfo: 提供了在Thymeleaf标准表达式里面被处理的模版的相关信息。
  1. /*
  2. * ======================================================================
  3. * See javadoc API for class org.thymeleaf.expression.ExecutionInfo
  4. * ======================================================================
  5. */
  6. /*
  7. * Return the name and mode of the 'leaf' template. This means the template
  8. * from where the events being processed were parsed. So if this piece of
  9. * code is not in the root template "A" but on a fragment being inserted
  10. * into "A" from another template called "B", this will return "B" as a
  11. * name, and B's mode as template mode.
  12. */
  13. ${#execInfo.templateName}
  14. ${#execInfo.templateMode}
  15. /*
  16. * Return the name and mode of the 'root' template. This means the template
  17. * that the template engine was originally asked to process. So if this
  18. * piece of code is not in the root template "A" but on a fragment being
  19. * inserted into "A" from another template called "B", this will still
  20. * return "A" and A's template mode.
  21. */
  22. ${#execInfo.processedTemplateName}
  23. ${#execInfo.processedTemplateMode}
  24. /*
  25. * Return the stacks (actually, List<String> or List<TemplateMode>) of
  26. * templates being processed. The first element will be the
  27. * 'processedTemplate' (the root one), the last one will be the 'leaf'
  28. * template, and in the middle all the fragments inserted in nested
  29. * manner to reach the leaf from the root will appear.
  30. */
  31. ${#execInfo.templateNames}
  32. ${#execInfo.templateModes}
  33. /*
  34. * Return the stack of templates being processed similarly (and in the
  35. * same order) to 'templateNames' and 'templateModes', but returning
  36. * a List<TemplateData> with the full template metadata.
  37. */
  38. ${#execInfo.templateStack}