jasp.buildin
Class Response

java.lang.Object
  |
  +--jasp.buildin.Response

public class Response
extends java.lang.Object

You can use the Response object to send output to the client.


Constructor Summary
Response()
           
 
Method Summary
static void _page_end()
          End this page
static void _PrintErrorMessage(java.lang.Exception ex)
          Output the exception message to the browser.
static void AddHeader(java.lang.String name, java.lang.String val)
          Sets the HTML header name to value.
static void AppendToLog(java.lang.String info)
          Adds a string to the end of the Web server log entry for this request.
static void BinaryWrite(byte[] data)
          Writes the specified information to the current HTTP output without any character conversion
static void BinaryWrite(char[] data)
          Writes the specified information to the current HTTP output without any character conversion
static void BinaryWrite(variant data)
          Writes the specified information to the current HTTP output without any character conversion
static void BinaryWrite(vbarray data)
          Writes the specified information to the current HTTP output without any character conversion
static void Charset(java.lang.String s)
          A string that specifies a character set for the page.
static void Clear()
          Erases any buffered HTML output.
static IWriteCookie Cookies(java.lang.String key)
           
static void End()
          Causes the Web server to stop processing the script and return the current result.
static void Flush()
          Sends buffered output immediately.
static boolean getBuffer()
          Gets if the page output is buffered.
static java.lang.String getCacheControl()
          Determines whether proxy servers are able to cache the output generated by ASP.
static java.lang.String getCharset()
          Gets the charset string.
static java.lang.String getContentType()
          Returns the content type.
static int getExpires()
          Returns the length of time before a page cached on a browser expires.
static int getExpiresAbsolute()
          Returns the date and time on which a page cached on a browser expires
static jasp.buildin.IWriter getOut()
          Gets the ASPResponse output stream.
static java.lang.String getStatus()
          Gets the value of the status line returned by the server.
static boolean IsClientConnected()
          Indicates whether the client has disconnected from the server.
static void Pics(java.lang.String p)
          Adds a value to the pics-label response header
static void Redirect(java.lang.String url)
          Causes the browser to attempt to connect to a different URL.
static jasp.buildin.ASPResponse response()
          Returns a Resposne instance.
static void setBuffer(boolean b)
          Sets whether page output is buffered.
static void setCacheControl(java.lang.String b)
          Sets CacheControl value
static void setCharset(java.lang.String s)
          Appends the name of the character set to the content-type header.
static void setContentType(java.lang.String c)
          Sets the HTTP content type for the response.
static void setCookies(java.lang.String key, double value)
          Sets the value of a cookie.
static void setCookies(java.lang.String key, int value)
          Sets the value of a cookie.
static void setCookies(java.lang.String key, java.lang.String value)
          Sets the value of a cookie.
static void setCookies(java.lang.String key, variant value)
          Sets the value of a cookie.
static void setCookies(java.lang.String key, vbdate value)
          Sets the value of a cookie.
static void setExpires(int val)
          Sets the length of time before a page cached on a browser expires
static void setExpiresAbsolute(int expire)
          Sets the date and time on which a page cached on a browser expires
static void setStatus(java.lang.String s)
          Sets the value of the status line returned by the server.
static void Write(boolean var)
          Writes a specified data to the current HTTP output.
static void Write(char var)
          Writes a specified data to the current HTTP output.
static void Write(java.util.Date var)
          Writes a specified data to the current HTTP output.
static void Write(double var)
          Writes a specified data to the current HTTP output.
static void Write(int var)
          Writes a specified data to the current HTTP output.
static void Write(long var)
          Writes a specified data to the current HTTP output.
static void Write(java.lang.Object var)
          Writes a specified data to the current HTTP output.
static void Write(java.lang.String var)
          Writes a specified data to the current HTTP output.
static void Write(variant var)
          Writes a specified data to the current HTTP output.
static void Write(vbcurrency var)
          Writes a specified data to the current HTTP output.
static void Write(vbdate var)
          Writes a specified data to the current HTTP output.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Response

public Response()
Method Detail

response

public static jasp.buildin.ASPResponse response()
Returns a Resposne instance.

setBuffer

public static void setBuffer(boolean b)
Sets whether page output is buffered.
Parameters:
b - a boolean value.

getBuffer

public static boolean getBuffer()
Gets if the page output is buffered.
Returns:
a boolean value.

getCacheControl

public static java.lang.String getCacheControl()
Determines whether proxy servers are able to cache the output generated by ASP.
Returns:
a string value.

setCacheControl

public static void setCacheControl(java.lang.String b)
Sets CacheControl value
Parameters:
b - the new cachecontrol value.

getCharset

public static java.lang.String getCharset()
Gets the charset string.
Returns:
a string value.

setCharset

public static void setCharset(java.lang.String s)
Appends the name of the character set to the content-type header.
Parameters:
the - charset string.

Charset

public static void Charset(java.lang.String s)
A string that specifies a character set for the page. The character set name will be appended to the content-type header in the Response object.
Parameters:
s - a charset string.

setContentType

public static void setContentType(java.lang.String c)
Sets the HTTP content type for the response.
Parameters:
c - the content type.

getContentType

public static java.lang.String getContentType()
Returns the content type.
Returns:
a string value.

getOut

public static jasp.buildin.IWriter getOut()
Gets the ASPResponse output stream.

setExpiresAbsolute

public static void setExpiresAbsolute(int expire)
Sets the date and time on which a page cached on a browser expires
Parameters:
expire - an integer value of the date and time.

getExpiresAbsolute

public static int getExpiresAbsolute()
Returns the date and time on which a page cached on a browser expires
Returns:
an integer value of the date and time.

IsClientConnected

public static boolean IsClientConnected()
Indicates whether the client has disconnected from the server. return false, if the client has disconnected from the server.

Pics

public static void Pics(java.lang.String p)
Adds a value to the pics-label response header
Parameters:
p - a String value

setStatus

public static void setStatus(java.lang.String s)
Sets the value of the status line returned by the server. Status values are defined in the HTTP specification
Parameters:
the - status value.

getStatus

public static java.lang.String getStatus()
Gets the value of the status line returned by the server. Status values are defined in the HTTP specification
Returns:
the status value.

getExpires

public static int getExpires()
Returns the length of time before a page cached on a browser expires.
Returns:
the length of time.

setExpires

public static void setExpires(int val)
Sets the length of time before a page cached on a browser expires
Parameters:
val - the length of time.

End

public static void End()
                throws java.lang.Exception
Causes the Web server to stop processing the script and return the current result. The remaining contents of the file are not processed.
Throws:
throw - an exception which number is 9998 to stop the current thread.

AddHeader

public static void AddHeader(java.lang.String name,
                             java.lang.String val)
Sets the HTML header name to value.

AppendToLog

public static void AppendToLog(java.lang.String info)
                        throws java.lang.Exception
Adds a string to the end of the Web server log entry for this request. You can call it multiple times in one section of script. Each time the method is called it appends the specified string to the existing entry.

The log file is <J-ASP-installed-dir>/logs/response.log
Parameters:
info - the logs infomation.

Clear

public static void Clear()
                  throws java.lang.Exception
Erases any buffered HTML output. However, the Clear method erases only the response body; it does not erase response headers

BinaryWrite

public static void BinaryWrite(vbarray data)
Writes the specified information to the current HTTP output without any character conversion
Parameters:
data - the specified infomation.

BinaryWrite

public static void BinaryWrite(variant data)
Writes the specified information to the current HTTP output without any character conversion
Parameters:
data - the specified infomation.

BinaryWrite

public static void BinaryWrite(char[] data)
Writes the specified information to the current HTTP output without any character conversion
Parameters:
data - the specified infomation.

BinaryWrite

public static void BinaryWrite(byte[] data)
Writes the specified information to the current HTTP output without any character conversion
Parameters:
data - the specified infomation.

Flush

public static void Flush()
Sends buffered output immediately.

Redirect

public static void Redirect(java.lang.String url)
                     throws java.lang.Exception
Causes the browser to attempt to connect to a different URL.
Parameters:
url - The Uniform Resource Locator that the browser is redirected to.

Write

public static void Write(variant var)
Writes a specified data to the current HTTP output.
Parameters:
var - The data to write.

Write

public static void Write(java.lang.Object var)
Writes a specified data to the current HTTP output.
Parameters:
var - The data to write.

Write

public static void Write(java.lang.String var)
Writes a specified data to the current HTTP output.
Parameters:
var - The data to write.

Write

public static void Write(vbdate var)
Writes a specified data to the current HTTP output.
Parameters:
var - The data to write.

Write

public static void Write(vbcurrency var)
Writes a specified data to the current HTTP output.
Parameters:
var - The data to write.

Write

public static void Write(java.util.Date var)
Writes a specified data to the current HTTP output.
Parameters:
var - The data to write.

Write

public static void Write(int var)
Writes a specified data to the current HTTP output.
Parameters:
var - The data to write.

Write

public static void Write(long var)
Writes a specified data to the current HTTP output.
Parameters:
var - The data to write.

Write

public static void Write(char var)
Writes a specified data to the current HTTP output.
Parameters:
var - The data to write.

Write

public static void Write(boolean var)
Writes a specified data to the current HTTP output.
Parameters:
var - The data to write.

Write

public static void Write(double var)
Writes a specified data to the current HTTP output.
Parameters:
var - The data to write.

Cookies

public static IWriteCookie Cookies(java.lang.String key)

setCookies

public static void setCookies(java.lang.String key,
                              double value)
Sets the value of a cookie. If the specified cookie does not exist, it is created. If the cookie exists, it takes the new value and the old value is discarded.
Parameters:
key - the name of the cookie.
value - the value of the cookie.

setCookies

public static void setCookies(java.lang.String key,
                              int value)
Sets the value of a cookie. If the specified cookie does not exist, it is created. If the cookie exists, it takes the new value and the old value is discarded.
Parameters:
key - the name of the cookie.
value - the value of the cookie.

setCookies

public static void setCookies(java.lang.String key,
                              variant value)
Sets the value of a cookie. If the specified cookie does not exist, it is created. If the cookie exists, it takes the new value and the old value is discarded.
Parameters:
key - the name of the cookie.
value - the value of the cookie.

setCookies

public static void setCookies(java.lang.String key,
                              vbdate value)
Sets the value of a cookie. If the specified cookie does not exist, it is created. If the cookie exists, it takes the new value and the old value is discarded.
Parameters:
key - the name of the cookie.
value - the value of the cookie.

setCookies

public static void setCookies(java.lang.String key,
                              java.lang.String value)
Sets the value of a cookie. If the specified cookie does not exist, it is created. If the cookie exists, it takes the new value and the old value is discarded.
Parameters:
key - the name of the cookie.
value - the value of the cookie.

_PrintErrorMessage

public static void _PrintErrorMessage(java.lang.Exception ex)
                               throws java.lang.Exception
Output the exception message to the browser.
Parameters:
ex - an exception .

_page_end

public static void _page_end()
End this page