Current response and its associated information.
Platform Support
Jaxer Server Framework | Jaxer Client Framework | 1.0 | no |
---|
Constructors
Constructor | Action | Jaxer Server Framework | Jaxer Client Framework | |||||
---|---|---|---|---|---|---|---|---|
Jaxer.Response Constructor(Object evt) : Jaxer.Response
An instance of this object has the lifecycle of the current response and contains information about it.
|
Show Details | 1.0 | no | |||||
Jaxer.Response(Object evt) : Jaxer.ResponseAn instance of this object has the lifecycle of the current response and contains information about it. Parameters
Returns
|
Properties
Property | Action | Jaxer Server Framework | Jaxer Client Framework |
---|---|---|---|
A collection of the HTTP response headers that will be returned to the browser, as properties on this simple JavaScript object.
If multiple headers have the same name, their values are given as an array. NOTE: some headers are set by the web server after
Jaxer is done, and they will not appear here.
|
No Details | 1.0 | no |
|
Functions
![]() |
||||||||||||
Method | Action | Jaxer Server Framework | Jaxer Client Framework | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
This will be true when the document processing has been exited before reaching the end of the document, via the exit() method
or another method such as redirect() which uses exit() internally. When that happens, some post-processing steps such as callback
proxying will be omitted.
(Advanced) |
No Details | 1.0 | no | |||||||||
|
||||||||||||
getContents() : String
Gets the contents (body) of the response. For regular page requests, this will return null unless setContents has been called,
in which case it will return the value set by the last call to setContents. For callbacks, this should only be called at the
very end of callback processing, when the contents have been explicitly set by the Jaxer framework using the setContents method.
(Advanced) |
Show Details | 1.0 | no | |||||||||
Returns
|
||||||||||||
getDomTouched() : Boolean
Has the DOM possibly been modified in any way?
(Advanced) |
Show Details | 1.0 | no | |||||||||
Returns
|
||||||||||||
getSideEffect() : Boolean
Has there been any possible side effect (e.g. database accessed, etc.)?
(Advanced) |
Show Details | 1.0 | no | |||||||||
Returns
|
||||||||||||
Remembers that the DOM has been altered in some way, which ensures that the final response will be the Jaxer-produced one
rather than the original document Jaxer received.
(Advanced) |
No Details | 1.0 | no | |||||||||
|
||||||||||||
Remembers that processing this page has had some side effect, which ensures that the final response will be treated as having
been processed by Jaxer, whether or not its contents have been modified.
(Advanced) |
No Details | 1.0 | no | |||||||||
|
||||||||||||
Once this is called, the contents of the response will be the same as the contents that Jaxer received in this request, i.e.
all DOM changes will be discarded. This is ONLY effective for regular requests, not callbacks.
(Advanced) |
No Details | 1.0 | no | |||||||||
|
||||||||||||
addHeader(String name, String value) :
void
Adds an HTTP header to the response. If an existing header with this name exists, this value will be appended -- if you don't
want that, just set Jaxer.response.headers [ name ] = value
|
Show Details | 1.0 | no | |||||||||
Parameters
|
||||||||||||
exit([Number statusCode,] [String contents,] [String reasonPhrase]) :
void
Stops processing the current request's HTML page and JavaScript, and returns this response to the browser via the web server.
|
Show Details | 1.0 | no | |||||||||
Parameters
|
||||||||||||
If Jaxer.Config.EXPOSE_JAXER, this sets an "X-Powered-By" header on the response indicating that Jaxer processing has occurred
and noting the build number.
|
No Details | 1.0 | no | |||||||||
|
||||||||||||
Gets the error, if any, of which the framework has been notified during the handling of this request and generation of this
response.
|
No Details | 1.0 | no | |||||||||
|
||||||||||||
getOverriddenClientFramework() : Object
Gets the parameters of the alternate client framework that will be injected into this response, if the default client framework
has been overridden using setClientFramework().
|
Show Details | 1.0 | no | |||||||||
Returns
|
||||||||||||
hasError() : Boolean
Has the framework been notified of an error during the handling of this request and generation of this response?
|
Show Details | 1.0 | no | |||||||||
Returns
|
||||||||||||
isClientFrameworkOverridden() : Boolean
Checks whether the client framework has been overridden for this response, i.e. whether setClientFramework has been called.
|
Show Details | 1.0 | no | |||||||||
Returns
|
||||||||||||
notifyError(Object newError, [Boolean avoidLogging]) :
void
Notifies the framework that an error has occurred during the handling of this request and generation of this response. How
this is handled is then determined by the Jaxer.Config settings.
|
Show Details | 1.0 | no | |||||||||
Parameters
|
||||||||||||
Notifies the framework that an error has already been reported in the output page so it need not be reported in the output
page again.
|
No Details | 1.0 | no | |||||||||
|
||||||||||||
redirect(String url, [Number statusCode,] [String reasonPhrase]) :
void
Stops processing the current request's HTML page and JavaScript, and returns a redirect-type HTTP response to the browser.
No contents (response body) are returned to the browser, and the DOM is not serialized.
|
Show Details | 1.0 | no | |||||||||
Parameters
|
||||||||||||
removeHeader(String name, String value) :
void
Removes an HTTP header with a specific value from the response. If there is no such name-value pair, it does nothing. If an
existing header with this name exists and has multiple values, this value will be removed -- if you don't want that, just
delete Jaxer.response.headers [ name ]
|
Show Details | 1.0 | no | |||||||||
Parameters
|
||||||||||||
Restores the use of the default client framework (using the Jaxer.Config settings), undoing any previous calls to setClientFramework().
|
No Details | 1.0 | no | |||||||||
|
||||||||||||
setClientFramework([String src,] [String contents]) :
void
Overrides the automatic injection of the client framework into the response page. If neither src nor contents are given, then
NO client framework is injected into the page. Make sure you do not rely (implicitly or explicitly) on the presence of the
default Jaxer client framework if you call this method!
|
Show Details | 1.0 | no | |||||||||
Parameters
|
||||||||||||
setContents(String contents) :
void
Sets the contents (body) of the response. Once the response's contents are set this way, the DOM is no longer serialized into
the response contents at the end of page processing.
|
Show Details | 1.0 | no | |||||||||
Parameters
|
||||||||||||
Sets headers on this response to mark it as a dynamic one and avoid its being cached. This will always be called by the framework
during callback processing. For regular (non-callback) requests, this will only be called by the framework if the DOM has
been changed or a side-effect has (or could have) occurred during the processing of this request and the generation of the
response.
|
No Details | 1.0 | no | |||||||||
|
||||||||||||
statusCodeToReasonPhrase(Number statusCode) :
void
Returns the standard W3C reason phrase for the given standard status code. For example, passing in 200 returns "OK", and passing
in 404 returns "Not Found".
|
Show Details | 1.0 | no | |||||||||
Parameters
|
||||||||||||
wasErrorShown() : Boolean
True if an error has already been reported in the output page so it need not be reported in the output page again.
|
Show Details | 1.0 | no | |||||||||
Returns
|