Interface WebScriptResponse

    • Method Summary

      All Methods Instance Methods Abstract 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
      java.io.OutputStream getOutputStream()
      Gets the Output Stream
      Runtime getRuntime()
      Gets the initiating runtime
      java.io.Writer getWriter()
      Gets the Writer
      void reset()
      Clears response buffer
      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
    • Method Detail

      • setStatus

        void setStatus​(int status)
        Sets the Response Status
        Parameters:
        status - int
      • setHeader

        void setHeader​(java.lang.String name,
                       java.lang.String value)
        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

        void addHeader​(java.lang.String name,
                       java.lang.String value)
        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

        void setContentType​(java.lang.String contentType)
        Sets the Content Type
        Parameters:
        contentType - String
      • setContentEncoding

        void setContentEncoding​(java.lang.String contentEncoding)
        Sets the Content Encoding
        Parameters:
        contentEncoding - String
      • setCache

        void setCache​(Cache cache)
        Sets the Cache control
        Parameters:
        cache - cache control
      • getWriter

        java.io.Writer getWriter()
                          throws java.io.IOException
        Gets the Writer
        Returns:
        writer
        Throws:
        java.io.IOException
      • getOutputStream

        java.io.OutputStream getOutputStream()
                                      throws java.io.IOException
        Gets the Output Stream
        Returns:
        output stream
        Throws:
        java.io.IOException
      • reset

        void reset()
        Clears response buffer
      • encodeScriptUrl

        java.lang.String encodeScriptUrl​(java.lang.String url)
        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
      • encodeResourceUrl

        java.lang.String encodeResourceUrl​(java.lang.String url)
        Encode a resource URL Note: Some Web Script Runtime environments (e.g. JSR-268, Surf) require urls to be re-written.
        Parameters:
        url - to encode
        Returns:
        encoded url
      • getEncodeScriptUrlFunction

        java.lang.String getEncodeScriptUrlFunction​(java.lang.String name)
        Return a client side javascript function to build urls to this service
        Parameters:
        name - Generated function name
        Returns:
        javascript function definition
      • getEncodeResourceUrlFunction

        java.lang.String getEncodeResourceUrlFunction​(java.lang.String name)
        Return a client side javascript function to build resource urls for this service
        Parameters:
        name - Generated function name
        Returns:
        javascript function definition
      • getRuntime

        Runtime getRuntime()
        Gets the initiating runtime
        Returns:
        runtime that constructed this response