Interface IMxRuntimeResponse


public interface IMxRuntimeResponse
This interface represents a response from the Mendix runtime. Using this interface, information about the response can be retrieved and modified.
  • Field Details

  • Method Details

    • getContentType

      String getContentType()
      Returns the currently set content type of the response.
    • getCharacterEncoding

      String getCharacterEncoding()
      Returns the currently set character encoding of the response.
    • setContentType

      void setContentType(String contentType)
      Sets the content type of the response.
      Parameters:
      contentType - the content type
    • setCharacterEncoding

      void setCharacterEncoding(String charset)
      Sets the character encoding of the response.
      Parameters:
      charset - the character set to use
    • getWriter

      Writer getWriter() throws IOException
      Returns a writer associated with this MxRuntimeResponse.
      Returns:
      a writer
      Throws:
      IOException - if the writer cannot be opened
    • sendError

      void sendError(String badRequest)
      Sends an internal server error as a response.
      Parameters:
      badRequest - the description of the error
    • getOutputStream

      OutputStream getOutputStream() throws IOException
      Returns an output stream for this response.
      Returns:
      the output stream
      Throws:
      RuntimeException - if getPrintWriter has already been called
      IOException
    • setStatus

      void setStatus(int status)
      Sets the status of the response.
      Parameters:
      status - the status code
    • setStatus

      @Deprecated void setStatus(int status, String msg)
      Deprecated.
      since version 9.13. This method will be removed in version 10. See HttpServletResponse.setStatus(int, String) for more details.
      Sets the status of the response with a message.
      Parameters:
      status - the status code
      msg - the message
    • addHeader

      void addHeader(String key, String value)
      Adds a header to the response.
      Parameters:
      key - the header key
      value - the header value
    • addCookie

      void addCookie(String key, String value)
      Adds a cookie to the response.
      Parameters:
      key - the cookie name
      value - the cookie value
    • addCookie

      void addCookie(String key, String value, String path, String domain, int expiry, boolean isHttpOnly)
      Adds a cookie to the response.
      Parameters:
      key - the cookie name
      value - the cookie value
      path - path for the cookie to which the client should return the cookie
      domain - the domain within which this cookie should be presented
      expiry - the maximum age in seconds for the cookie
      isHttpOnly - set the HttpOnly attribute of the cookie
    • addCookie

      void addCookie(String key, String value, String path, String domain, int expiry, boolean isHttpOnly, boolean isHostOnly)
      Adds a cookie to the response.
      Parameters:
      key - the cookie name
      value - the cookie value
      path - path for the cookie to which the client should return the cookie
      domain - the domain within which this cookie should be presented
      expiry - the maximum age in seconds for the cookie
      isHttpOnly - set the HttpOnly attribute of the cookie
      isHostOnly - prefix key with __Host-
    • addCookie

      void addCookie(String key, String value, String path, String domain, int expiry)
      Adds a cookie to the response.
      Parameters:
      key - the cookie name
      value - the cookie value
      path - path for the cookie to which the client should return the cookie
      domain - the domain within which this cookie should be presented
      expiry - the maximum age in seconds for the cookie
    • addCookie

      void addCookie(String key, String value, boolean isHttpOnly)
      Adds a cookie to the response.
      Parameters:
      key - the cookie name
      value - the cookie value
      isHttpOnly - set the HttpOnly attribute of the cookie
    • addCookie

      void addCookie(String key, String value, boolean isHttpOnly, boolean isHostOnly)
      Adds a cookie to the response.
      Parameters:
      key - the cookie name
      value - the cookie value
      isHttpOnly - set the HttpOnly attribute of the cookie
      isHostOnly - prefix key with __Host-
    • getHttpServletResponse

      javax.servlet.http.HttpServletResponse getHttpServletResponse()
      Returns the Servlet response associated with this MxRuntimeResponse.