Interface RawTemplateDispatcher
- All Known Implementing Classes:
FreemarkerDispatcher,JspDispatcher,MustacheDispatcher,ThymeleafDispatcher
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 TypeMethodDescriptionvoidrender(String path, RestRequest req, RestResponse res) Renders the raw template identified by the trailing request path onto the response.
-
Method Details
-
render
Renders the raw template identified by the trailing request path onto the response.Implementations resolve
pathagainst 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 asBasicHttpExceptionsubtypes (unchecked), so this method only declares the checkedIOException.- Parameters:
path- The trailing path segment after the mount prefix (the template / file name relative to the configured base path). May benull(treated as empty).req- The current REST request.res- The current REST response.- Throws:
IOException- If the underlying response writer fails.
-