Class CmsServletContainerSettings

java.lang.Object
org.opencms.main.CmsServletContainerSettings

public class CmsServletContainerSettings extends Object
Stores specific servlet container options, that might influence OpenCms behavior.

Since:
7.0.5
  • Field Details

  • Constructor Details

    • CmsServletContainerSettings

      public CmsServletContainerSettings(javax.servlet.ServletContext context)
      Creates a new object.

      Parameters:
      context - used to find out specifics of the servlet container
    • CmsServletContainerSettings

      protected CmsServletContainerSettings(String webInfRfsPath, String defaultWebApplication, String servletMapping, String servletContainerName, String webApplicationContext)
      Creates an instance based on the given values.

      This is intended for CmsShell access.

      Parameters:
      webInfRfsPath - the OpenCms web application "WEB-INF" path in the "real" file system) to set
      servletMapping - the OpenCms servlet mapping (e.g. "/opencms/*")
      webApplicationContext - the name/path of the OpenCms web application context (optional, will be calculated form the path if null)
      defaultWebApplication - the default web application name (usually "ROOT")
      servletContainerName - the name of the servlet container running OpenCms
  • Method Details

    • isServletThrowsException

      public static boolean isServletThrowsException()
      Checks if the servlet can throw an exception if initialization fails.

      Returns:
      true if the servlet can throw an exception if initialization fails
    • getContextPath

      Returns the web application context path, e.g. "" (empty String) if the web application is the default web application (usually "ROOT"), or "/opencms" if the web application is called "opencms".

      From the Java Servlet Specification v2.4:
      Context Path: The path prefix associated with the ServletContext that this servlet is a part of. If this context is the "default" context rooted at the base of the web server's URL name space, this path will be an empty string. Otherwise, if the context is not rooted at the root of the server's name space, the path starts with a "/" character but does not end with a "/" character.

      Returns:
      the web application context path
      See Also:
    • getDefaultWebApplicationName

      Returns the default web application name (usually "ROOT").

      Returns:
      the default web application name
    • getMode

      Returns the mode.

      Returns:
      the mode
    • getOpenCmsContext

      Returns the OpenCms request context, e.g. "/opencms/opencms".

      The OpenCms context will always start with a "/" and never have a trailing "/". The OpenCms context is identical to getContexPath() + getServletPath().

      Returns:
      the OpenCms request context, e.g. "/opencms/opencms"
      See Also:
    • getRequestErrorPageAttribute

      Returns the request error page attribute.

      Returns:
      the request error page attribute
    • getServletContainerName

      Returns the name of the servlet container running OpenCms.

      Returns:
      the name of the servlet container running OpenCms
    • getServletPath

      Returns the OpenCms servlet path, e.g. "/opencms".

      From the Java Servlet Specification v2.4:
      Servlet Path: The path section that directly corresponds to the mapping which activated this request. This path starts with a?/? character except in the case where the request is matched with the ?/*? pattern, in which case it is the empty string.

      Returns:
      the OpenCms servlet path
      See Also:
    • getWebApplicationName

      Returns the OpenCms web application name, e.g. "opencms" or "ROOT" (no leading or trailing "/").

      The web application name is stored for informational purposes only. If you want to construct an URI, use either getContextPath() and getServletPath(), or for links to the OpenCms VFS use getOpenCmsContext().

      Returns:
      the OpenCms web application name
      See Also:
    • getWebApplicationRfsPath

      Returns the OpenCms web application folder in the servlet container.

      Returns:
      the OpenCms web application folder in the servlet container
    • getWebInfRfsPath

      Returns the OpenCms web application "WEB-INF" directory path.

      Returns:
      the OpenCms web application "WEB-INF" directory path
    • isPreventResponseFlush

      public boolean isPreventResponseFlush()
      Checks if the flex response has to prevent buffer flushing.

      Returns:
      true if the flex response has to prevent buffer flushing
    • isReleaseTagsAfterEnd

      public boolean isReleaseTagsAfterEnd()
      Checks if the tags need to be released after ending.

      Returns:
      true if the tags need to be released after ending
    • setMode

      public void setMode(String configValue)
      Sets the mode from the configuration.

      Parameters:
      configValue - the mode to set
    • setPreventResponseFlush

      public void setPreventResponseFlush(boolean preventResponseFlush)
      Sets if the flex response has to prevent buffer flushing.

      Parameters:
      preventResponseFlush - the flag to set
    • setReleaseTagsAfterEnd

      public void setReleaseTagsAfterEnd(boolean releaseTagsAfterEnd)
      Sets if the tags need to be released after ending.

      Parameters:
      releaseTagsAfterEnd - the flag to set
    • setRequestErrorPageAttribute

      public void setRequestErrorPageAttribute(String requestErrorPageAttribute)
      Sets the request error page attribute.

      Parameters:
      requestErrorPageAttribute - the request error page attribute to set
    • setServletThrowsException

      public void setServletThrowsException(boolean servletThrowsException)
      Sets if the servlet can throw an exception if initialization fails.

      Parameters:
      servletThrowsException - the flag to set