Class HttpServletContainerServices

    • Constructor Detail

      • HttpServletContainerServices

        public HttpServletContainerServices()
        Creates a new ServletContainerServices object.
      • HttpServletContainerServices

        public HttpServletContainerServices​(boolean hasOutputStream)
    • Method Detail

      • getRemoteAddress

        public java.lang.String getRemoteAddress()
        Description copied from interface: ContainerServices
        This method returns the client IP address
        Returns:
        A String with the value of the client IP address
      • getRealPath

        public java.lang.String getRealPath​(java.lang.String relPath)
        Description copied from interface: ContainerServicesContext
        This is a low level API call to the outside world - it returns the real path to a server-side resource. Exactly what is returned depends upon the underlying implementation. Note that this may be null if the path is inside an archived file. This call doesn't feature resource caching or MicroStrategy Web application's custom prefix (i.e. ABSOLUTE and RELATIVE) handling. Using FileLoader.getRealPath(String) may be more appropriate.
        Parameters:
        relPath - A String that indicates the relative path of the file.
        Returns:
        A String that indicates the full path of the file.
        See Also:
        FileLoader.getRealPath(String)
      • getResourceAsStream

        public java.io.InputStream getResourceAsStream​(java.lang.String relPath)
        Description copied from interface: ContainerServicesContext
        This method returns the contents of a file resource relative to the web application as an input stream.

        This is ONLY required to support the Java environment, and in particular, only those Java environments where the WAR file is not expanded. This should return NULL in an ASP environment.

        Parameters:
        relPath - A String that indicates the relative path of the file.
        Returns:
        A InputStream that contains the contents of the specified file.
      • getQueryString

        public java.lang.String getQueryString()
        Description copied from interface: ContainerServices
        This method returns the entire Query String.
        Returns:
        A String that contains the contents of the Query String.
      • getHeaderValue

        public java.lang.String getHeaderValue​(java.lang.String headerName)
        Description copied from interface: ContainerServices
        This method returns the value of the requested header
        Parameters:
        headerName - A String with the name of the header to search for
        Returns:
        A String with the value of the header requested. If the header was not found, it shall return a null value.
      • getRequestAttribute

        public java.lang.Object getRequestAttribute​(java.lang.String name)
        Description copied from interface: ContainerServices
        This method returns the value of a Request Attribute. In Java, there is a clear distinction between Request and Session variables. In ASP, the two are combined as there is not a similar concept.
        Parameters:
        name - the name of an attribute.
        Returns:
        An Object representing the value of a named attribute.
      • setRequestAttribute

        public void setRequestAttribute​(java.lang.String name,
                                        java.lang.Object value)
        Description copied from interface: ContainerServices
        This method sets the value of a Request Attribute. In Java, there is a clear distinction between Request and Session variables. In ASP, the two are combined as there is not a similar concept.
        Parameters:
        name - A String which identifies the name of the attribute.
        value - An Object representing the value of a named attribute.
      • setSessionAttribute

        public void setSessionAttribute​(java.lang.String name,
                                        java.lang.Object value)
        Description copied from interface: ContainerServices
        This method sets the value of a Session Attribute. In Java, there is a clear distinction between Request and Session variables. In ASP, the two are combined as there is not a similar concept.
        Parameters:
        name - A String which identifies the name of the attribute.
        value - An Object representing the value of a named attribute.
      • setSessionAttribute

        public void setSessionAttribute​(java.lang.String name,
                                        java.lang.Object value,
                                        ContainerServicesNamespace namespace)
        Description copied from interface: ContainerServices
        This method sets the value of a Session Attribute in the given namespace. In Java, there is a clear distinction between Request and Session variables. In ASP, the two are combined as there is not a similar concept.
        Parameters:
        name - A String which identifies the name of the attribute.
        value - An Object representing the value of a named attribute.
        namespace - A ContainerServicesNamespace object representing the namespace requirement. If null, no namespace is used.
        Since:
        MicroStrategy Web 8.0.2
      • getSessionStrings

        public ContainerStringCollection getSessionStrings()
        Description copied from interface: ContainerServices
        This method returns the contents of the Session Variables as a collection of sub strings (as name/value pairs). Only those session variables that return values of type String are considered.
        Returns:
        A ContainerStringCollection object.
      • addCookieToResponse

        public void addCookieToResponse​(GenericCookie cookie)
        Description copied from interface: ContainerServices
        This method associates a platform-independent Cookie with a response. When the response is sent back to the client, it will contain this cookie.
        Parameters:
        cookie - The GenericCookie to be added to the Response.
      • getMultipartRequest

        public MultipartRequest getMultipartRequest()
        Deprecated.
        this is only used internally by MicroStrategy methods, and may not be visible in future releases
      • getPostedFile

        public PostedFile getPostedFile​(java.lang.String name)
        Description copied from interface: ContainerServices
        Provides a way to access individual files that have been uploaded by a client.
        Parameters:
        name - a name of posted file
        Returns:
        a posted file
      • getRequestServerName

        public java.lang.String getRequestServerName()
        Description copied from interface: ContainerServices
        This method returns the Web Server Name from the request object
        Returns:
        A String that indicates the Web Server Name. (i.e. if you access the web server with the URL which reads as http://localhost:8080/MicroStrategy/servlet then this method will return "localhost" as the web server name. If you access the webserver with the URL which reads as http://machine1:8080/MicroStrategy/servlet then this method will return "machine1" as the web server name.
      • getSessionID

        public java.lang.String getSessionID()
        Description copied from interface: ContainerServices
        Returns HTTP session ID
        Returns:
        HTTP session ID
      • sendBinaryContent

        public void sendBinaryContent​(MarkupOutput mo)
        Description copied from interface: ContainerServices
        Outputs binary content of the MarkupOutput
        Parameters:
        mo - markup outpu containing binary image
      • setHeaderValue

        public void setHeaderValue​(java.lang.String name,
                                   java.lang.String value)
        Description copied from interface: ContainerServices
        Sets HTTP response header
        Parameters:
        name - header name
        value - header value
      • getApplicationPath

        public java.lang.String getApplicationPath()
        This method returns the application full path of the servlet
        Returns:
        A String that indicates the full application path of the servlet. (i.e. http://localhost:8080/MicroStrategy/servlet/)
      • setContentType

        public void setContentType​(java.lang.String type)
        Description copied from interface: ContainerServices
        Stes HTTP response content type
        Parameters:
        type - content type
      • getCodePage

        public int getCodePage()
        Description copied from interface: ContainerServices
        Returns an integer that represents the character formatting codepage. The CodePage property specifies how literal (static) strings are encoded in a Web page. A codepage is a character set that can include numbers, punctuation marks, and other glyphs. Codepages are not the same for each language. Some languages have multi-byte characters, while others only need one byte to represent each character.
        Returns:
        an integer that represents the character formatting codepage.
      • setCodePage

        public void setCodePage​(int code)
        Description copied from interface: ContainerServices
        Sets the code page, an integer representing the character formatting. The CodePage property specifies how literal (static) strings are encoded in a Web page. A codepage is a character set that can include numbers, punctuation marks, and other glyphs. Codepages are not the same for each language. Some languages have multi-byte characters, while others only need one byte to represent each character.
        Parameters:
        code - an integer that represents the character formatting codepage.
      • getRequest

        public javax.servlet.http.HttpServletRequest getRequest()
        This method retrieves the HttpServletRequest object associated with this class.
        Returns:
        A HttpServletRequest object.
      • setRequest

        public void setRequest​(javax.servlet.http.HttpServletRequest request)
        This method sets the HttpServletRequest object which is to be associated with this class.
        Parameters:
        request - A HttpServletRequest object.
      • getResponse

        public javax.servlet.http.HttpServletResponse getResponse()
        This method retrieves the HttpServletResponse object associated with this class.
        Returns:
        A HttpServletResponse object.
      • setResponse

        public void setResponse​(javax.servlet.http.HttpServletResponse response)
        This method sets the HttpServletResponse object which is to be associated with this class.
        Parameters:
        response - A HttpServletResponse object.
      • getServletContext

        public javax.servlet.ServletContext getServletContext()
        This method retrieves the ServletContext object associated with this class.
        Returns:
        A ServletContext object.
      • setServletContext

        public void setServletContext​(javax.servlet.ServletContext servletContext)
        This method sets the ServletContext object which is to be associated with this class.
        Parameters:
        servletContext - A ServletContext object.
      • getSession

        public javax.servlet.http.HttpSession getSession()
        This method retrieves the HttpSession object associated with this class.
        Returns:
        A HttpSession object.
      • setSession

        public void setSession​(javax.servlet.http.HttpSession session)
        This method sets the HttpSession object which is to be associated with this class.
        Parameters:
        session - A HttpSession object.
      • getServletConfig

        public javax.servlet.ServletConfig getServletConfig()
      • setServletConfig

        public void setServletConfig​(javax.servlet.ServletConfig newValue)
      • getSessionAttribute

        public java.lang.Object getSessionAttribute​(java.lang.String name)
        Description copied from interface: ContainerServices
        This method returns the value of a Session Attribute. In Java, there is a clear distinction between Request and Session variables. In ASP, the two are combined as there is not a similar concept.
        Parameters:
        name - the name of an attribute.
        Returns:
        An Object representing the value of a named session attribute.
      • getSessionAttribute

        public java.lang.Object getSessionAttribute​(java.lang.String name,
                                                    ContainerServicesNamespace namespace)
        Description copied from interface: ContainerServices
        This method returns the value of a Session Attribute. In Java, there is a clear distinction between Request and Session variables. In ASP, the two are combined as there is not a similar concept.
        Parameters:
        name - the name of an attribute.
        namespace - the name of the URL parameter that privides the namespace name.
        Returns:
        An Object representing the value of a named session attribute.
        Since:
        MicroStrategy Web 8.0.2
      • getApplicationAttribute

        public java.lang.Object getApplicationAttribute​(java.lang.String name)
        Description copied from interface: ContainerServices
        This method returns the value of an Application Attribute.
        Parameters:
        name - the name of an attribute.
        Returns:
        An Object representing the value of a named application attribute.
      • setApplicationAttribute

        public void setApplicationAttribute​(java.lang.String name,
                                            java.lang.Object value)
        Description copied from interface: ContainerServices
        This method sets the value of a Application Attribute.
        Parameters:
        name - A String which identifies the name of the attribute.
        value - An Object representing the value of a named attribute.
      • sendError

        public boolean sendError​(int sc)
        Description copied from interface: ContainerServices
        Sends an error response to the client using the specified status code.
        Parameters:
        sc - The status errror code. We reuse HTTP status code "OK" (200) to mean no error, so please do not use it for any error status.
        Returns:
        true to indicate this action succeeded. false to indicate error in performing this action.
      • sendError

        public boolean sendError​(int sc,
                                 java.lang.String msg)
        Description copied from interface: ContainerServices
        Sends an error response to the client using the specified status code.
        Parameters:
        sc - The errror status code.
        msg - The error message.
        Returns:
        true to indicate this action succeeded. false to indicate error in performing this action.
      • isJavaURLSessionSupported

        public boolean isJavaURLSessionSupported()
        Indicates if the instance of this container services supports cookieless environments
        Returns:
        true if cookieless environments are supported
      • setJavaURLSessionSupported

        public void setJavaURLSessionSupported​(boolean value)
        Sets if the instance of this container services supports cookieless environments
        Parameters:
        value - true if cookieless environment is supported
      • getServerVariables

        public ContainerStringCollection getServerVariables()
        Description copied from interface: ContainerServices
        Returns a collection of server variables.
        Returns:
        a collection of server variables.
        Since:
        MicroStrategy Web 7.5.4
      • getStatusCode

        public int getStatusCode()
        Description copied from interface: ContainerServices
        Returns the HTTP Status code specified for this response.
        Returns:
        The HTTP Status code specified for this response.
        Since:
        MicroStrategy Web 9.0.0
      • setStatusCode

        public void setStatusCode​(int statusCode)
        Description copied from interface: ContainerServices
        Sets the HTTP Status code specified for this response.
        Parameters:
        statusCode - the HTTP Status code specified for this response.
        Since:
        MicroStrategy Web 9.0.0
      • getOutputStream

        public java.io.OutputStream getOutputStream()
        Since:
        MicroStrategy Web 9.0.0
      • hasOutputStream

        public boolean hasOutputStream()
        Since:
        MicroStrategy Web 9.0.0
      • isRequestSecure

        public boolean isRequestSecure()
        Description copied from interface: ContainerServices
        Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS
        Since:
        MicroStrategy Web 9.0.0
      • getResource

        public java.net.URL getResource​(java.lang.String relPath)
        Description copied from interface: ContainerServicesContext
        Returns the URL associated with the given resource path. If the resource does not exist, null is returned (i.e. it cannot return a path to a new File). Note that many URL implementations are read-only.
        Parameters:
        relPath - relative path.
        Returns:
        URL associated with given path.
        Since:
        MicroStrategy Web 9.0.0
      • getResourcePaths

        public java.util.Set<java.lang.String> getResourcePaths​(java.lang.String relPath)
        Description copied from interface: ContainerServicesContext
        Returns a directory path strings of all the paths to resources within the application whose longest sub-path matches the supplied path.
        Parameters:
        relPath - sub-path to match
        Returns:
        Set of directory paths
        Since:
        MicroStrategy Web 9.0.0
      • getAppServerInfo

        public java.lang.String getAppServerInfo()
        Since:
        MicroStrategy Web 9.0.0
      • getContextPath

        public java.lang.String getContextPath()
        Description copied from interface: ContainerServicesContext
        Returns the context path. In the out of the box Web application deployment, this is usually "/MicroStrategy". Note that subclasses can override this implementation to return different context paths.
        Returns:
        the context path.
        Since:
        MicroStrategy Web 9.0.1
      • isSessionlessRequest

        public boolean isSessionlessRequest()
        Description copied from interface: ContainerServices
        Does the request has a pre-established session id.
      • invalidateHttpSession

        public void invalidateHttpSession()
        Description copied from interface: ContainerServices
        If the security preference is selected, invalidate and create new http session in jsp part set a flag to show whether a new session need to be created in asp part
      • getMethod

        public java.lang.String getMethod()
        Description copied from interface: ContainerServices
        Return the request's method is post or get
      • getSessionMaxIdleTime

        public int getSessionMaxIdleTime()
        Description copied from interface: ContainerServices
        Returns the maximum time interval, in seconds, that the container will keep this session open between client accesses.