Class WebUiServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
de.aristaflow.adept2.base.servlet.SimpleServingServlet
de.aristaflow.adept2.ui.web.WebUiServlet
All Implemented Interfaces:
DynamicServlet, jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

@ConfigurationDescription(properties={@Property(name="AfBaseUrl",defaultValue="AristaFlowREST",description="Optional base URL for the AristaFlow core services."),,,,}) public class WebUiServlet extends de.aristaflow.adept2.base.servlet.SimpleServingServlet
A simple servlet providing the web UI from a base URL. This appends the requested path to the base URL and returns the retrieved result (UTF-8-encoded character stream). Deep links will be adapted appropriately.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final String
    The base URL for the core services or an empty string
    protected final String
    The base URL for the PIR service or an empty string
    protected final String
    The base URL for the Remote HTML service or an empty string
    protected final String
    The base URL for a standalone PIR service or an empty string
    protected final String
    The base href to set in the index.html
    static final String
    Configuration key for the base URL for the AristaFlow core services.
    static final String
    Configuration key for the AristaFlow Process Image Renderer.
    static final String
    Configuration key for the AristaFlow Remote HTML Runtime Manager.
    static final String
    Configuration key for a standalone AristaFlow Process Image Renderer.
    static final String
    Configuration key for the base href to use.
    static final String
    The configuration key for the configuration variable providing the servlet path and the CONF_BASE_HREF.
    protected final String
    Cached and configured index.html content.
    protected static final String
    The POM properties file within the bundle providing the version.
    protected final org.apache.tika.mime.MediaType
    The media type of indexHtml.

    Fields inherited from class de.aristaflow.adept2.base.servlet.SimpleServingServlet

    base, logger, servletName

    Fields inherited from class jakarta.servlet.http.HttpServlet

    LEGACY_DO_HEAD
  • Constructor Summary

    Constructors
    Constructor
    Description
    WebUiServlet(Configuration conf, de.aristaflow.adept2.base.servlet.AbstractServingServletService asss, Registry registry)
    Creates a new servlet providing web UI from the designated base URL.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
    adaptPath(String path, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)
     
    protected void
    doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)
     
    protected boolean
    handle(String path, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)
     

    Methods inherited from class de.aristaflow.adept2.base.servlet.SimpleServingServlet

    getMimeType, getServletName, servletDeployed, servletUndeployed

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doHead, doOptions, doPatch, doPost, doPut, doTrace, getLastModified, init, isSensitiveHeader, service, service

    Methods inherited from class jakarta.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, init, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface jakarta.servlet.Servlet

    destroy, getServletConfig, getServletInfo, init, service
  • Field Details

    • CONF_VAR_SERVLET_PATH

      public static final String CONF_VAR_SERVLET_PATH
      The configuration key for the configuration variable providing the servlet path and the CONF_BASE_HREF.
      See Also:
    • POM_PROPERTIES_FILE

      protected static final String POM_PROPERTIES_FILE
      The POM properties file within the bundle providing the version.
      See Also:
    • CONF_AF_BASE_URL

      public static final String CONF_AF_BASE_URL
      Configuration key for the base URL for the AristaFlow core services.
      See Also:
    • CONF_AF_REMOTE_HTML_BASE_URL

      public static final String CONF_AF_REMOTE_HTML_BASE_URL
      Configuration key for the AristaFlow Remote HTML Runtime Manager.
      See Also:
    • CONF_AF_PIR_BASE_URL

      public static final String CONF_AF_PIR_BASE_URL
      Configuration key for the AristaFlow Process Image Renderer.
      See Also:
    • CONF_AF_SPIR_BASE_URL

      public static final String CONF_AF_SPIR_BASE_URL
      Configuration key for a standalone AristaFlow Process Image Renderer.
      See Also:
    • CONF_BASE_HREF

      public static final String CONF_BASE_HREF
      Configuration key for the base href to use.
      See Also:
    • afBaseUrl

      protected final String afBaseUrl
      The base URL for the core services or an empty string
    • afRemoteHtmlBaseUrl

      protected final String afRemoteHtmlBaseUrl
      The base URL for the Remote HTML service or an empty string
    • afPirBaseUrl

      protected final String afPirBaseUrl
      The base URL for the PIR service or an empty string
    • afSpirBaseUrl

      protected final String afSpirBaseUrl
      The base URL for a standalone PIR service or an empty string
    • baseHref

      protected final String baseHref
      The base href to set in the index.html
    • indexHtml

      protected final String indexHtml
      Cached and configured index.html content.
    • utf8TextMt

      protected final org.apache.tika.mime.MediaType utf8TextMt
      The media type of indexHtml.
  • Constructor Details

    • WebUiServlet

      public WebUiServlet(Configuration conf, de.aristaflow.adept2.base.servlet.AbstractServingServletService asss, Registry registry) throws IOException
      Creates a new servlet providing web UI from the designated base URL.
      Parameters:
      conf - Servlet-specific configuration. This is not used by this class.
      asss - The serving servlet service instantiating this servlet. This provdies the base URL of the content, that is the corresponding root directory (may be in a Jar-file), and the log service.
      registry - The registry providing the instance name which is also the servlet name.
      Throws:
      IOException - If there are problems reading the index.html from the library, an IOException will be thrown.
  • Method Details

    • adaptPath

      protected String adaptPath(String path, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)
      Overrides:
      adaptPath in class de.aristaflow.adept2.base.servlet.SimpleServingServlet
    • doGet

      protected void doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws IOException
      Overrides:
      doGet in class de.aristaflow.adept2.base.servlet.SimpleServingServlet
      Throws:
      IOException
    • handle

      protected boolean handle(String path, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws IOException
      Overrides:
      handle in class de.aristaflow.adept2.base.servlet.SimpleServingServlet
      Throws:
      IOException