Class FreemarkerRenderScope

java.lang.Object
org.apache.juneau.rest.server.view.freemarker.FreemarkerRenderScope

public final class FreemarkerRenderScope extends Object
Request-scoped handle so FreeMarker TemplateDirectiveModels can resolve per-request asset URLs during template.process.

FreemarkerViewRenderer opens the scope around its template.process(...) call and always closes it in a finally, so directives such as <@page toolkit=...> can reach the in-flight RestRequest (e.g. to call ViewsMixin.viewAssetUrl) without threading it through every template model.

Since:
10.0.0
  • Method Details

    • request

      public static RestRequest request()
      Returns the request for the in-flight FreeMarker render.
      Returns:
      The RestRequest for the in-flight FreeMarker render, or null if none.