Class WebScriptServletResponse

    • Constructor Summary

      Constructors 
      Constructor Description
      WebScriptServletResponse​(Runtime container, javax.servlet.http.HttpServletResponse res)
      Construct
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addHeader​(java.lang.String name, java.lang.String value)
      Adds a response header with the given name and value.
      java.lang.String encodeResourceUrl​(java.lang.String url)
      Encode a resource URL Note: Some Web Script Runtime environments (e.g.
      java.lang.String encodeScriptUrl​(java.lang.String url)
      Encode a script URL Note: Some Web Script Runtime environments (e.g.
      java.lang.String getEncodeResourceUrlFunction​(java.lang.String name)
      Return a client side javascript function to build resource urls for this service
      java.lang.String getEncodeScriptUrlFunction​(java.lang.String name)
      Return a client side javascript function to build urls to this service
      javax.servlet.http.HttpServletResponse getHttpServletResponse()
      Gets the HTTP Servlet Response
      java.io.OutputStream getOutputStream()
      Gets the Output Stream
      java.io.Writer getWriter()
      Gets the Writer
      void reset()
      Clears response buffer including status and headers
      void reset​(java.lang.String preserveHeadersPattern)
      Clears response including status and headers except the specified headers.
      void setCache​(Cache cache)
      Sets the Cache control
      void setContentEncoding​(java.lang.String contentEncoding)
      Sets the Content Encoding
      void setContentType​(java.lang.String contentType)
      Sets the Content Type
      void setHeader​(java.lang.String name, java.lang.String value)
      Set a response header with the given name and value.
      void setStatus​(int status)
      Sets the Response Status
      • Methods inherited from class java.lang.Object

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

      • WebScriptServletResponse

        public WebScriptServletResponse​(Runtime container,
                                        javax.servlet.http.HttpServletResponse res)
        Construct
        Parameters:
        container - Runtime
        res - HttpServletResponse
    • Method Detail

      • getHttpServletResponse

        public javax.servlet.http.HttpServletResponse getHttpServletResponse()
        Gets the HTTP Servlet Response
        Returns:
        HTTP Servlet Response
      • setStatus

        public void setStatus​(int status)
        Description copied from interface: WebScriptResponse
        Sets the Response Status
        Parameters:
        status - int
      • setHeader

        public void setHeader​(java.lang.String name,
                              java.lang.String value)
        Description copied from interface: WebScriptResponse
        Set a response header with the given name and value. If the header has already been set, the new value overwrites the previous one.
        Parameters:
        name - header name
        value - header value
      • addHeader

        public void addHeader​(java.lang.String name,
                              java.lang.String value)
        Description copied from interface: WebScriptResponse
        Adds a response header with the given name and value. This method allows a response header to have multiple values.
        Parameters:
        name - header name
        value - header value
      • setContentType

        public void setContentType​(java.lang.String contentType)
        Description copied from interface: WebScriptResponse
        Sets the Content Type
        Parameters:
        contentType - String
      • setContentEncoding

        public void setContentEncoding​(java.lang.String contentEncoding)
        Description copied from interface: WebScriptResponse
        Sets the Content Encoding
        Parameters:
        contentEncoding - String
      • setCache

        public void setCache​(Cache cache)
        Description copied from interface: WebScriptResponse
        Sets the Cache control
        Parameters:
        cache - cache control
      • reset

        public void reset()
        Description copied from interface: WebScriptResponse
        Clears response buffer including status and headers
      • reset

        public void reset​(java.lang.String preserveHeadersPattern)
        Description copied from interface: WebScriptResponse
        Clears response including status and headers except the specified headers. REPO-4388 allow certain headers not to be reset
        Parameters:
        preserveHeadersPattern - Headers which will not be reset with using a regex pattern.
      • getWriter

        public java.io.Writer getWriter()
                                 throws java.io.IOException
        Description copied from interface: WebScriptResponse
        Gets the Writer
        Returns:
        writer
        Throws:
        java.io.IOException
      • getOutputStream

        public java.io.OutputStream getOutputStream()
                                             throws java.io.IOException
        Description copied from interface: WebScriptResponse
        Gets the Output Stream
        Returns:
        output stream
        Throws:
        java.io.IOException
      • encodeScriptUrl

        public java.lang.String encodeScriptUrl​(java.lang.String url)
        Description copied from interface: WebScriptResponse
        Encode a script URL Note: Some Web Script Runtime environments (e.g. JSR-168, JSF) require urls to be re-written.
        Parameters:
        url - to encode
        Returns:
        encoded url
      • getEncodeScriptUrlFunction

        public java.lang.String getEncodeScriptUrlFunction​(java.lang.String name)
        Description copied from interface: WebScriptResponse
        Return a client side javascript function to build urls to this service
        Parameters:
        name - Generated function name
        Returns:
        javascript function definition