The 'response' Object |
Active Web |
The response object allows the developer to control how the output of the executing script is delivered to the calling client browser. The ‘response’ object contains properties such as the mime type of the response and client browser cookies. It also contains functions allowing the developer to switch from character mode output to a binary mode ‘raw’ output.
Any changes made to the 'response' object only affect the current delivery of the page.
Shown below is the request object prototype chain.
The response object is of class Object.
Property |
Description |
contentType |
The "mime" type of the document sent back to the browser. By default this is set to the mime type defined for the script page suffix (defined in the Active Web Admin Console) and for an html or htm page will be "text/html". This property can be changed to any of the acceptable mime types. A list of mime types is given here. |
cookies |
A collection of cookies that will be sent back to the browser (see Using Cookies). |
prototype |
A reference to the Object Prototype. This property does not enumerate and can not be deleted but can be changed. |
binaryMode |
A Boolean indicating whether the response is in binary mode or nor. |
isCommitted |
A Boolean indicating if any part of the response has been sent to the requesting client. |
Function |
Description |
setBinaryMode() |
Causes the response to switch to binary mode; if the response is already in binary mode then the function call has no effect. |
getBinaryMode() |
Returns a Boolean indicating whether the response is in binary mode or not. |
isCommitted() |
Returns a Boolean indicating if the any part of the response has been sent to the requesting client browser. |
You can set any header you wish in the Http response of the generated page. You do this by creating properties of the response object. These properties have a string value where the Http header name is separated from its value by a colon.
For example
response.expires = "Expires: Thu, 01 Dec 1994 16:00:00 GMT";
Will cause the Http header Expires to be generated as part of the response and it will have a value of the date specified.
Topic ID: 150105