Class ViewResource
java.lang.Object
org.apache.juneau.rest.server.servlet.RestResource
org.apache.juneau.rest.server.view.ViewResource
- Direct Known Subclasses:
FreemarkerResource,JspResource,MustacheResource,ThymeleafResource
Abstract base for the child-resource flavors of the view mixin resources.
Mirror of ViewServlet for routed-child deployment: each per-engine bridge module ships a thin
<Engine>Resource subclass that declares its own subtree mount via
@Rest(path) (e.g. "/jsp") and supplies the per-engine
RawTemplateDispatcher (the matching flavor-neutral <Engine>Dispatcher worker) via
dispatcher().
The single greedy op declared here (@RestGet(path="/*")) captures the trailing remainder under
the child's subtree mount and delegates straight to the shared RawTemplateDispatcher, so the
mixin, servlet, and child forms cannot drift.
See Also:
- Since:
- 10.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.juneau.rest.server.servlet.RestResource
RestResource.Builder<R extends RestResource,SELF extends RestResource.Builder<R, SELF>>, RestResource.DefaultBuilder<R extends RestResource> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract RawTemplateDispatcherReturns the per-engineRawTemplateDispatcherthis child delegates raw template dispatch to.voidrender(String path, RestRequest req, RestResponse res) [GET /*] — render the raw template identified by the trailing path under this child's subtree mount.Methods inherited from class org.apache.juneau.rest.server.servlet.RestResource
builder, doLog, getContext, getPaths, getRequest, getResponse, getRestBuilder, log, log, setContext
-
Constructor Details
-
ViewResource
public ViewResource()
-
-
Method Details
-
dispatcher
Returns the per-engineRawTemplateDispatcherthis child delegates raw template dispatch to.Typically the matching flavor-neutral
<Engine>Dispatcherworker (which implementsRawTemplateDispatcher). Nevernull.- Returns:
- The raw-template dispatcher. Never
null.
-
render
[GET /*] — render the raw template identified by the trailing path under this child's subtree mount.- Parameters:
path- The trailing path segment after the mount prefix.req- The current REST request.res- The current REST response.- Throws:
IOException- If the underlying response writer fails.
-