Interface RawTemplateDispatcher

All Known Implementing Classes:
FreemarkerDispatcher, JspDispatcher, MustacheDispatcher, ThymeleafDispatcher

public interface RawTemplateDispatcher
Engine-agnostic raw-template-dispatch contract shared by the view mixin resources and their standalone servlet companions.

Not to be confused with ViewRenderer — that is the response-processor marker that renders View-typed @RestOp return values. This contract instead covers the raw file-serving path: serving a .jsp / .ftlh / .mustache / .html template directly by its trailing request path.

The per-engine flavor-neutral worker beans (JspDispatcher, FreemarkerDispatcher, MustacheDispatcher, ThymeleafDispatcher) implement this interface; the three flavor classes (<Engine>Mixin / <Engine>Servlet / <Engine>Resource) each hold one of these workers and delegate to it. Sharing a single implementation at the worker-bean level means the mixin, servlet, and child forms cannot drift in their file-serving behavior.

The single render(...) method receives the trailing request path (the multi-segment remainder captured by the host's @Path("/*") binding), resolves it against the implementation's configured base path, and writes the rendered output directly onto the response.

See Also:
Since:
10.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Renders the raw template identified by the trailing request path onto the response.
  • Method Details

    • render

      void render(String path, RestRequest req, RestResponse res) throws IOException
      Renders the raw template identified by the trailing request path onto the response.

      Implementations resolve path against their configured base path (rejecting any .. traversal), ask the underlying templating engine for the resource, and write it to the response writer. Boundary violations and engine errors surface as BasicHttpException subtypes (unchecked), so this method only declares the checked IOException.

      Parameters:
      path - The trailing path segment after the mount prefix (the template / file name relative to the configured base path). May be null (treated as empty).
      req - The current REST request.
      res - The current REST response.
      Throws:
      IOException - If the underlying response writer fails.