Class JspMixin.Builder

java.lang.Object
org.apache.juneau.rest.server.view.jsp.JspMixin.Builder
All Implemented Interfaces:
ViewMixinBuilder<JspMixin.Builder>
Enclosing class:
JspMixin

public static class JspMixin.Builder extends Object implements ViewMixinBuilder<JspMixin.Builder>
Builder for JspMixin.

Mirrors JspDispatcher.Builder's configuration methods on its own surface and forwards each call into a held JspDispatcher.Builder (worker-bean composition). Implements ViewMixinBuilder so basePath(String) is guaranteed to transfer to the sibling Thymeleaf / Mustache / FreeMarker bridge builders; see cacheTemplates(boolean) for this bridge's no-op conformance caveat.

  • Constructor Details

  • Method Details

    • basePath

      Sets the classpath / webapp base path under which .jsp resources are resolved.

      Defaults to "/". A typical configured value is "/WEB-INF/views/" — the Servlet-spec convention for hiding template files from direct HTTP access.

      Specified by:
      basePath in interface ViewMixinBuilder<JspMixin.Builder>
      Parameters:
      value - The base path. null or blank values reset to the default JspMixin.DEFAULT_BASE_PATH.
      Returns:
      This object.
    • cacheTemplates

      public JspMixin.Builder cacheTemplates(boolean value)
      Accepted for ViewMixinBuilder conformance; has no effect on the JSP bridge.

      JSP recompilation is delegated entirely to the servlet container via RequestDispatcher.forward(...) — there is no bridge-owned template cache to disable. Containers manage their own JSP recompilation policy (e.g. Tomcat's Jasper development / modificationTestInterval servlet-init-params, or Jetty's equivalent) outside this bridge's control. The value is stored and reported back by isCacheTemplates() / JspMixin.isCacheTemplates() purely so callers coding against the shared ViewMixinBuilder contract get a consistent round-trip, not because it changes rendering behavior.

      Specified by:
      cacheTemplates in interface ViewMixinBuilder<JspMixin.Builder>
      Parameters:
      value - The cache flag (recorded only; see above).
      Returns:
      This object.
    • getBasePath

      public String getBasePath()
      Reads the current base path setting (test/inspection helper).
      Returns:
      The base path. Never null.
    • isCacheTemplates

      public boolean isCacheTemplates()
      Reads the current cache-templates setting (test/inspection helper).

      See cacheTemplates(boolean) — this bridge has no template cache to report on; the value is whatever was last recorded.

      Returns:
      The cache flag.
    • build

      public JspMixin build()
      Builds the JspMixin.
      Returns:
      A new JspMixin instance.