Class JspDispatcher
java.lang.Object
org.apache.juneau.rest.server.view.jsp.JspDispatcher
- All Implemented Interfaces:
RawTemplateDispatcher
Flavor-neutral worker bean carrying the JSP raw-template-dispatch logic shared by the
JspMixin mixin, the JspServlet servlet, and the JspResource child flavors.
This is the flavor-neutral worker for the JSP capability: it is not one of the
three @Rest flavor classes — it is a plain bean that implements
RawTemplateDispatcher and holds the capability state (basePath) plus the raw-serve
logic. Each flavor independently holds an instance of this worker and delegates to it, so no flavor
is another flavor's worker.
See Also:
- Since:
- 10.0.0
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault base path applied when noJspDispatcher.Builder.basePath(String)call has been made. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJspDispatcher(JspDispatcher.Builder builder) Builder constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic JspDispatcher.Buildercreate()Creates a new builder.Returns the base path under which.jspresources are resolved.voidrender(String path, RestRequest req, RestResponse res) Forwards the request to the JSP engine for the raw.jspresource at the trailing path.
-
Field Details
-
DEFAULT_BASE_PATH
Default base path applied when noJspDispatcher.Builder.basePath(String)call has been made.- See Also:
-
-
Constructor Details
-
JspDispatcher
Builder constructor.- Parameters:
builder- The builder. Must not benull.
-
-
Method Details
-
create
Creates a new builder.- Returns:
- A new builder.
-
getBasePath
Returns the base path under which.jspresources are resolved.- Returns:
- The base path. Never
null.
-
render
Forwards the request to the JSP engine for the raw.jspresource at the trailing path.- Specified by:
renderin interfaceRawTemplateDispatcher- Parameters:
path- The trailing path segment after the mount prefix (the JSP file name relative to the configuredbase path).req- The current REST request.res- The current REST response.- Throws:
IOException- If the underlying servlet writer fails.NotFound- If the JSP resource cannot be resolved.
-