Interface WebScriptResponse

All Known Subinterfaces:
WrappingWebScriptResponse
All Known Implementing Classes:
WebScriptResponseImpl, WebScriptServletResponse, WebScriptViewResponse

public interface WebScriptResponse
Web Script Response
Author:
davidc
  • Field Details

  • Method Details

    • setStatus

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

      void setHeader(String name, 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(String name, 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(String contentType)
      Sets the Content Type
      Parameters:
      contentType - String
    • setContentEncoding

      void setContentEncoding(String contentEncoding)
      Sets the Content Encoding
      Parameters:
      contentEncoding - String
    • setCache

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

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

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

      void reset()
      Clears response buffer including status and headers
    • reset

      void reset(String preserveHeadersPattern)
      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.
    • encodeScriptUrl

      String encodeScriptUrl(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

      String encodeResourceUrl(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

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

      String getEncodeResourceUrlFunction(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