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 SummaryFieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds a cookie to the response.voidAdds a cookie to the response.voidAdds a cookie to the response.voidAdds a cookie to the response.voidAdds a cookie to the response.voidaddCookie(String key, String value, String path, String domain, int expiry, boolean isHttpOnly, boolean isHostOnly) Adds a cookie to the response.voidAdds 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.HttpServletResponseReturns the Servlet response associated with this MxRuntimeResponse.Returns an output stream for this response.Returns a writer associated with this MxRuntimeResponse.voidSends an internal server error as a response.voidsetCharacterEncoding(String charset) Sets the character encoding of the response.voidsetContentType(String contentType) Sets the content type of the response.voidsetStatus(int status) Sets the status of the response.voidDeprecated.since version 9.13.
- 
Field Details- 
OKstatic final int OK- See Also:
 
- 
SEE_OTHERstatic final int SEE_OTHER- See Also:
 
- 
NOT_MODIFIEDstatic final int NOT_MODIFIED- See Also:
 
- 
BAD_REQUESTstatic final int BAD_REQUEST- See Also:
 
- 
UNAUTHORIZEDstatic final int UNAUTHORIZED- See Also:
 
- 
NEED_PAYMENTstatic final int NEED_PAYMENT- See Also:
 
- 
FORBIDDENstatic final int FORBIDDEN- See Also:
 
- 
NOT_FOUNDstatic final int NOT_FOUND- See Also:
 
- 
METHOD_NOT_ALLOWEDstatic final int METHOD_NOT_ALLOWED- See Also:
 
- 
CONFLICTstatic final int CONFLICT- See Also:
 
- 
TOO_MANY_REQUESTSstatic final int TOO_MANY_REQUESTS- See Also:
 
- 
SESSION_KILLEDstatic final int SESSION_KILLED- See Also:
 
- 
INTERNAL_SERVER_ERRORstatic final int INTERNAL_SERVER_ERROR- See Also:
 
- 
SERVICE_UNAVAILABLEstatic final int SERVICE_UNAVAILABLE- See Also:
 
- 
XAS_ERROR_CODEstatic final int XAS_ERROR_CODE- See Also:
 
- 
DATAVALIDATION_ERROR_CODEstatic final int DATAVALIDATION_ERROR_CODE- See Also:
 
 
- 
- 
Method Details- 
getContentTypeString getContentType()Returns the currently set content type of the response.
- 
getCharacterEncodingString getCharacterEncoding()Returns the currently set character encoding of the response.
- 
setContentTypeSets the content type of the response.- Parameters:
- contentType- the content type
 
- 
setCharacterEncodingSets the character encoding of the response.- Parameters:
- charset- the character set to use
 
- 
getWriterReturns a writer associated with this MxRuntimeResponse.- Returns:
- a writer
- Throws:
- IOException- if the writer cannot be opened
 
- 
sendErrorSends an internal server error as a response.- Parameters:
- badRequest- the description of the error
 
- 
getOutputStreamReturns an output stream for this response.- Returns:
- the output stream
- Throws:
- RuntimeException- if getPrintWriter has already been called
- IOException
 
- 
setStatusvoid setStatus(int status) Sets the status of the response.- Parameters:
- status- the status code
 
- 
setStatusDeprecated.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 code
- msg- the message
 
- 
addHeaderAdds a header to the response.- Parameters:
- key- the header key
- value- the header value
 
- 
addCookieAdds a cookie to the response.- Parameters:
- key- the cookie name
- value- the cookie value
 
- 
addCookievoid 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
 
- 
addCookievoid 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-
 
- 
addCookieAdds 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
 
- 
addCookieAdds a cookie to the response.- Parameters:
- key- the cookie name
- value- the cookie value
- isHttpOnly- set the HttpOnly attribute of the cookie
 
- 
addCookieAdds 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-
 
- 
getHttpServletResponsejavax.servlet.http.HttpServletResponse getHttpServletResponse()Returns the Servlet response associated with this MxRuntimeResponse.
 
-