Class CmsServletContainerSettings


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

    Since:
    7.0.5
    • Constructor Detail

      • 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​(java.lang.String webInfRfsPath,
                                              java.lang.String defaultWebApplication,
                                              java.lang.String servletMapping,
                                              java.lang.String servletContainerName,
                                              java.lang.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 Detail

      • 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

        public java.lang.String 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:
        getWebApplicationName(), getServletPath(), getOpenCmsContext()
      • getDefaultWebApplicationName

        public java.lang.String getDefaultWebApplicationName()
        Returns the default web application name (usually "ROOT").

        Returns:
        the default web application name
      • getOpenCmsContext

        public java.lang.String 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:
        getContextPath(), getServletPath()
      • getRequestErrorPageAttribute

        public java.lang.String getRequestErrorPageAttribute()
        Returns the request error page attribute.

        Returns:
        the request error page attribute
      • getServletContainerName

        public java.lang.String getServletContainerName()
        Returns the name of the servlet container running OpenCms.

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

        public java.lang.String 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:
        getContextPath(), getWebApplicationName(), getOpenCmsContext()
      • getWebApplicationRfsPath

        public java.lang.String getWebApplicationRfsPath()
        Returns the OpenCms web application folder in the servlet container.

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

        public java.lang.String 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​(java.lang.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​(java.lang.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