Class GenericServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.pentaho.platform.web.servlet.ServletBase
org.pentaho.platform.web.servlet.GenericServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable, org.pentaho.platform.api.engine.ILogger

public class GenericServlet extends ServletBase
See Also:
  • Field Summary

    Fields inherited from class org.pentaho.platform.web.servlet.ServletBase

    debug

    Fields inherited from class jakarta.servlet.http.HttpServlet

    LEGACY_DO_HEAD

    Fields inherited from interface org.pentaho.platform.api.engine.ILogger

    ACTIVITY_LOG, DEBUG, ERROR, FATAL, INFO, INSTANCE_LOG, SESSION_LOG, SOLUTION_LOG, TRACE, UNKNOWN, WARN
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    allowBrowserCache(String maxAge, org.pentaho.platform.api.engine.IParameterProvider pathParams)
     
    protected boolean
    doesStaticResourceExist(org.pentaho.platform.api.engine.IPluginManager pluginManager, String pluginId, String staticResourceUrl)
    Checks if a static resource, given its relative URL actually exists.
    protected void
    doGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
     
    protected void
    doPost(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
     
    protected org.pentaho.platform.api.engine.ICacheManager
     
    org.apache.commons.logging.Log
     
    protected org.pentaho.platform.api.engine.IOutputHandler
    getOutputHandler(jakarta.servlet.http.HttpServletResponse response, boolean allowFeedback)
     
    protected org.pentaho.platform.api.engine.IPluginManager
    getPluginManager(jakarta.servlet.http.HttpServletRequest request)
     
    void
     
    protected boolean
    isPluginCacheOn(org.pentaho.platform.api.engine.IPluginManager pluginManager, String pluginId)
    Checks if the cache is enabled for the given plugin.
    boolean
    isStaticResource(jakarta.servlet.http.HttpServletRequest request)
    Determines if the request is for an existing static resource handled by this content generator handler assuming it's being served via its default URL, /content.

    Methods inherited from class org.pentaho.platform.web.servlet.ServletBase

    debug, debug, error, error, fatal, fatal, getLoggingLevel, getObjectName, getPentahoSession, info, info, setCorsHeaders, setLoggingLevel, trace, trace, warn, warn

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doHead, doOptions, doPut, doTrace, getLastModified, init, service, service

    Methods inherited from class jakarta.servlet.GenericServlet

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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GenericServlet

      public GenericServlet()
  • Method Details

    • getLogger

      public org.apache.commons.logging.Log getLogger()
      Specified by:
      getLogger in class ServletBase
    • init

      public void init() throws jakarta.servlet.ServletException
      Overrides:
      init in class jakarta.servlet.GenericServlet
      Throws:
      jakarta.servlet.ServletException
    • isStaticResource

      public boolean isStaticResource(@NonNull jakarta.servlet.http.HttpServletRequest request)
      Determines if the request is for an existing static resource handled by this content generator handler assuming it's being served via its default URL, /content.

      This particular method can be used without performing servlet initialization, via init().

      The implementation of this method uses the exact same rules used by doGet(HttpServletRequest, HttpServletResponse) to identify static resources. The two must be kept in sync.

      Parameters:
      request - The request.
      Returns:
      true if the request is for a static resource; false, otherwise.
    • doesStaticResourceExist

      protected boolean doesStaticResourceExist(@NonNull org.pentaho.platform.api.engine.IPluginManager pluginManager, @NonNull String pluginId, @NonNull String staticResourceUrl)
      Checks if a static resource, given its relative URL actually exists.

      This method is used by isStaticResource(HttpServletRequest) to determine if a static resource actually exists, and not only whether its URL is public.

      This method uses the deprecated method IPluginManager.getStaticResource(String) so that it behaves the closest possible to doGet(HttpServletRequest, HttpServletResponse).

      Parameters:
      pluginManager - The plugin manager.
      pluginId - The plugin ID.
      staticResourceUrl - The static resource URL.
      Returns:
      true if the static resource exists; false, otherwise.
    • getCacheManager

      protected org.pentaho.platform.api.engine.ICacheManager getCacheManager()
    • isPluginCacheOn

      protected boolean isPluginCacheOn(@NonNull org.pentaho.platform.api.engine.IPluginManager pluginManager, @NonNull String pluginId)
      Checks if the cache is enabled for the given plugin.
      Parameters:
      pluginManager - The plugin manager.
      pluginId - The plugin ID.
      Returns:
      true if the cache is enabled; false, otherwise.
    • doPost

      protected void doPost(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException
      Overrides:
      doPost in class jakarta.servlet.http.HttpServlet
      Throws:
      jakarta.servlet.ServletException
      IOException
    • doGet

      protected void doGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException
      Overrides:
      doGet in class jakarta.servlet.http.HttpServlet
      Throws:
      jakarta.servlet.ServletException
      IOException
    • allowBrowserCache

      protected void allowBrowserCache(String maxAge, org.pentaho.platform.api.engine.IParameterProvider pathParams)
    • getOutputHandler

      protected org.pentaho.platform.api.engine.IOutputHandler getOutputHandler(jakarta.servlet.http.HttpServletResponse response, boolean allowFeedback) throws IOException
      Throws:
      IOException
    • getPluginManager

      protected org.pentaho.platform.api.engine.IPluginManager getPluginManager(jakarta.servlet.http.HttpServletRequest request)