Package com.mendix.m2ee.api
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 Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a cookie to the response.void
Adds a cookie to the response.void
Adds a cookie to the response.void
Adds a cookie to the response.void
Adds a cookie to the response.void
addCookie
(String key, String value, String path, String domain, int expiry, boolean isHttpOnly, boolean isHostOnly) Adds a cookie to the response.void
Adds a header to the response.Returns the currently set character encoding of the response.Returns the currently set content type of the response.javax.servlet.http.HttpServletResponse
Returns the Servlet response associated with this MxRuntimeResponse.Returns an output stream for this response.Returns a writer associated with this MxRuntimeResponse.void
Sends an internal server error as a response.void
setCharacterEncoding
(String charset) Sets the character encoding of the response.void
setContentType
(String contentType) Sets the content type of the response.void
setStatus
(int status) Sets the status of the response.void
Deprecated.since version 9.13.
-
Field Details
-
OK
static final int OK- See Also:
-
SEE_OTHER
static final int SEE_OTHER- See Also:
-
NOT_MODIFIED
static final int NOT_MODIFIED- See Also:
-
BAD_REQUEST
static final int BAD_REQUEST- See Also:
-
UNAUTHORIZED
static final int UNAUTHORIZED- See Also:
-
NEED_PAYMENT
static final int NEED_PAYMENT- See Also:
-
FORBIDDEN
static final int FORBIDDEN- See Also:
-
NOT_FOUND
static final int NOT_FOUND- See Also:
-
METHOD_NOT_ALLOWED
static final int METHOD_NOT_ALLOWED- See Also:
-
CONFLICT
static final int CONFLICT- See Also:
-
TOO_MANY_REQUESTS
static final int TOO_MANY_REQUESTS- See Also:
-
SESSION_KILLED
static final int SESSION_KILLED- See Also:
-
INTERNAL_SERVER_ERROR
static final int INTERNAL_SERVER_ERROR- See Also:
-
SERVICE_UNAVAILABLE
static final int SERVICE_UNAVAILABLE- See Also:
-
XAS_ERROR_CODE
static final int XAS_ERROR_CODE- See Also:
-
DATAVALIDATION_ERROR_CODE
static final int DATAVALIDATION_ERROR_CODE- See Also:
-
-
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
Sets the content type of the response.- Parameters:
contentType
- the content type
-
setCharacterEncoding
Sets the character encoding of the response.- Parameters:
charset
- the character set to use
-
getWriter
Returns a writer associated with this MxRuntimeResponse.- Returns:
- a writer
- Throws:
IOException
- if the writer cannot be opened
-
sendError
Sends an internal server error as a response.- Parameters:
badRequest
- the description of the error
-
getOutputStream
Returns an output stream for this response.- Returns:
- the output stream
- Throws:
RuntimeException
- if getPrintWriter has already been calledIOException
-
setStatus
void setStatus(int status) Sets the status of the response.- Parameters:
status
- the status code
-
setStatus
Deprecated.since version 9.13. This method will be removed in version 10. SeeHttpServletResponse.setStatus(int, String)
for more details.Sets the status of the response with a message.- Parameters:
status
- the status codemsg
- the message
-
addHeader
Adds a header to the response.- Parameters:
key
- the header keyvalue
- the header value
-
addCookie
Adds a cookie to the response.- Parameters:
key
- the cookie namevalue
- 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 namevalue
- the cookie valuepath
- path for the cookie to which the client should return the cookiedomain
- the domain within which this cookie should be presentedexpiry
- the maximum age in seconds for the cookieisHttpOnly
- 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 namevalue
- the cookie valuepath
- path for the cookie to which the client should return the cookiedomain
- the domain within which this cookie should be presentedexpiry
- the maximum age in seconds for the cookieisHttpOnly
- set the HttpOnly attribute of the cookieisHostOnly
- prefix key with __Host-
-
addCookie
Adds a cookie to the response.- Parameters:
key
- the cookie namevalue
- the cookie valuepath
- path for the cookie to which the client should return the cookiedomain
- the domain within which this cookie should be presentedexpiry
- the maximum age in seconds for the cookie
-
addCookie
Adds a cookie to the response.- Parameters:
key
- the cookie namevalue
- the cookie valueisHttpOnly
- set the HttpOnly attribute of the cookie
-
addCookie
Adds a cookie to the response.- Parameters:
key
- the cookie namevalue
- the cookie valueisHttpOnly
- set the HttpOnly attribute of the cookieisHostOnly
- prefix key with __Host-
-
getHttpServletResponse
javax.servlet.http.HttpServletResponse getHttpServletResponse()Returns the Servlet response associated with this MxRuntimeResponse.
-