Jaxer.Response : Object
Return to: Jaxer Framework index

Current response and its associated information.

Platform Support

Jaxer Server Framework Jaxer Client Framework
0.9 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 0.9 no

Jaxer.Response(Object evt) : Jaxer.Response

An instance of this object has the lifecycle of the current response and contains information about it.

Parameters
Object evt The Jaxer Core event whose data is used to initialize this Response object instance and to output to the client

Returns
Jaxer.Response Returns an instance of Response.

Functions

Method Action Jaxer Server Framework Jaxer Client Framework
getContents() : String
Gets the contents (body) of the response. This is ONLY effective at the very end of callback processing, when the contents have been explicitly set using the setContents method.

(Advanced)
Show Details 0.9 no

Returns
String The explicitly-set contents at this time

getDomTouched() : Boolean
Has the DOM possibly been modified in any way?

(Advanced)
Show Details 0.9 no

Returns
Boolean true if it has (or might have), false if it could not have been

getSideEffect() : Boolean
Has there been any possible side effect (e.g. database accessed, etc.)?

(Advanced)
Show Details 0.9 no

Returns
Boolean true if there has been (or might have been), false if there could not have been

noteDomTouched() : void
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 0.9 no
noteSideEffect() : void
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 0.9 no
addHeader(String name, String value, Boolean replaceExisting) : void
Adds an HTTP header to the response, possibly replacing any existing one of the same name
Show Details 0.9 no

Parameters
String name The name of the HTTP header
String value The value to use
Boolean replaceExisting If true and there is an existing header with the same name, it will be replaced

exposeJaxer() : void
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 0.9 no
getError() : void
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 0.9 no
getHeader(Object nameOrIndex) : String
Gets the value of a header on the current response.

Known Limitation: only response headers set by the Jaxer framework are currently accessible. Any previous handler's or filter's headers are not.
Show Details 0.9 no

Parameters
Object nameOrIndex If this is a number, it's used as the index to the list of headers, otherwise the list is searched for the first header having this name.

Returns
String The value of the header, or the empty string of none was found

getHeaderCount() : Number
Gets the number of headers in the response.

Known Limitation: only response headers set by the Jaxer framework are currently accessible. Any previous handler's or filter's headers are not.
Show Details 0.9 no

Returns
Number The number of headers

getHeaderName(Number index) : String
Gets the name of the header with the given index.

Known Limitation: only response headers set by the Jaxer framework are currently accessible. Any previous handler's or filter's headers are not.
Show Details 0.9 no

Parameters
Number index The index of the header, which should be less than the value returned by getHeaderCount().

Returns
String The name of the header

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 0.9 no

Returns
Object A JavaScript object with properties isSrc (Boolean indicating whether the value is the src or the contents of the script block to be injected) and value (the src or the contents).

hasError() : Boolean
Has the framework been notified of an error during the handling of this request and generation of this response?
Show Details 0.9 no

Returns
Boolean True if an error was submitted.

Checks whether the client framework has been overridden for this response, i.e. whether setClientFramework has been called.
Show Details 0.9 no

Returns
Boolean true if the client framework is overridden, false otherwise

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 0.9 no

Parameters
Object newError The error describing what happened. If the framework has already been notified of an error during the current request, this newError is not used.
Boolean avoidLogging (optional)If this evaluates to true, an error message will not be logged during this call. Note that if an error message has been logged already in this request, another message will not be logged in any case.

notifyErrorShown() : void
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 0.9 no
resetClientFramework() : void
Restores the use of the default client framework (using the Jaxer.Config settings), undoing any previous calls to setClientFramework().
No Details 0.9 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 0.9 no

Parameters
String src (optional)The url of the alternate client framework to use, if any. If this src argument is given, any contents argument will not be used.
String contents (optional)The contents of the script block to use as an alternate client framework. If a src argument is specified, the contents argument will not be used.

setContents(String contents) : void
Sets the contents (body) of the response. This ONLY affects the response during a callback, otherwise the contents will be set to the serialized DOM or to the original response's contents.
Show Details 0.9 no

Parameters
String contents The new contents to use.

setNoCacheHeaders() : void
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 0.9 no
useOriginalContents() : void
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.
No Details 0.9 no
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 0.9 no

Returns
Boolean True if notifyErrorShown() was called in this response, false otherwise.

aptana_docs