com.plumtree.openfoundation.web
Interface IXPResponse

All Known Implementing Classes:
XPResponse

public interface IXPResponse

Summary description for IXPResponse.


Method Summary
 void AddCookie(XPCookie cookie)
          Adds the specified cookie to the response.
 void AddHeader(java.lang.String name, java.lang.String _value)
          Adds a response header with the given name and value.
 void Clear()
          Clears any data that exists in the buffer as well as the status code and headers.
 void ClearUnderlyingObject()
          This method clears all the instance variables to avoid memory leak.
 java.lang.String EncodeRedirectURL(java.lang.String url)
          Deprecated. This method is deprecated because Redirect() method already encodes url
 void Flush()
          This method writes all data to the client.
 java.lang.String GetCharacterEncoding()
          Returns the name of the charset used for the MIME body sent in this response If no charset has been assigned, it is implicitly set to ISO-8859-1 (Latin-1).
 XPOutputStream GetOutputStream()
          This method returns an output stream for writing binary data to the client.
 void Redirect(java.lang.String url)
          Sends a temporary redirect response to the client using the specified redirect location URL.
 void SetContentType(java.lang.String type)
          Sets the content type of the response being sent to the client.
 void SetDateHeader(java.lang.String name, long date)
          Sets a response header with the given name and date-value.
 void SetStatus(int sc)
          Sets the status code for this response.
 void SetStatus(int sc, java.lang.String msg)
          Sets the status code and message for this response.
 void Write(char c)
          This method writes a character to the client.
 void Write(char[] s)
          This method writes an array of characters to the client.
 void Write(java.lang.Object o)
          This method writes an object to the client.
 void Write(java.lang.String s)
          This method writes a string to the client.
 void WriteLine(char c)
          This method writes a character followed by an end of line to the client.
 void WriteLine(char[] s)
          This method writes an array of characters followed by an end of line to the client.
 void WriteLine(java.lang.Object o)
          This method writes an object followed by an end of line to the client.
 void WriteLine(java.lang.String s)
          This method writes a string followed by an end of line to the client.
 

Method Detail

Flush

void Flush()
This method writes all data to the client. This automatically writes the status code and headers.


GetOutputStream

XPOutputStream GetOutputStream()
This method returns an output stream for writing binary data to the client.

Returns:
OutputStream wrapped in XPOutputStream object

GetCharacterEncoding

java.lang.String GetCharacterEncoding()
Returns the name of the charset used for the MIME body sent in this response If no charset has been assigned, it is implicitly set to ISO-8859-1 (Latin-1).

Returns:
String representing the character encoding

Clear

void Clear()
Clears any data that exists in the buffer as well as the status code and headers.


SetContentType

void SetContentType(java.lang.String type)
Sets the content type of the response being sent to the client.

Parameters:
type - - content type to be sent.

SetDateHeader

void SetDateHeader(java.lang.String name,
                   long date)
Sets a response header with the given name and date-value.

Parameters:
name - - a String containing name of the Date header
date - - a long containing date in milliseconds since EPOCH. Use XPDateTime.GetTimeInMilliseconds() to produce a commensurate value.

AddCookie

void AddCookie(XPCookie cookie)
Adds the specified cookie to the response.

Parameters:
cookie - the XPCookie object to add to the response.

EncodeRedirectURL

java.lang.String EncodeRedirectURL(java.lang.String url)
Deprecated. This method is deprecated because Redirect() method already encodes url

Encodes the specified URL for use in the sendRedirect method or, if encoding is not needed, returns the URL unchanged.

Parameters:
url - url string to be encoded
Returns:
encoded url string

AddHeader

void AddHeader(java.lang.String name,
               java.lang.String _value)
Adds a response header with the given name and value.

Parameters:
name - - name of the header to be set
_value - - value of the header to be set

Redirect

void Redirect(java.lang.String url)
Sends a temporary redirect response to the client using the specified redirect location URL.

Parameters:
url - - the redirect location url

SetStatus

void SetStatus(int sc)
Sets the status code for this response.

Parameters:
sc - - the status code.

SetStatus

void SetStatus(int sc,
               java.lang.String msg)
Sets the status code and message for this response.

Parameters:
sc - - the status code
msg - - the status msg.

Write

void Write(char c)
This method writes a character to the client. Either the Write* methods or the GetOutputStream() method may be used to output data, but not both.

Parameters:
c - - the character to be written.

Write

void Write(java.lang.Object o)
This method writes an object to the client. Either the Write* methods or the GetOutputStream() method may be used to output data, but not both. Calling the Write* methods can be significantly slower than just calling GetOutputStream() once and writing lot's of data to that XPOutputStream.

Parameters:
o - - the object to be written.

Write

void Write(java.lang.String s)
This method writes a string to the client. Either the Write* methods or the GetOutputStream() method may be used to output data, but not both. Calling the Write* methods can be significantly slower than just calling GetOutputStream() once and writing lot's of data to that XPOutputStream.

Parameters:
s - - the String to be written.

Write

void Write(char[] s)
This method writes an array of characters to the client. Either the Write* methods or the GetOutputStream() method may be used to output data, but not both. Calling the Write* methods can be significantly slower than just calling GetOutputStream() once and writing lot's of data to that XPOutputStream.

Parameters:
s - - the arry of characters to be written.

WriteLine

void WriteLine(char c)
This method writes a character followed by an end of line to the client. Either the Write* methods or the GetOutputStream() method may be used to output data, but not both. Calling the Write* methods can be significantly slower than just calling GetOutputStream() once and writing lot's of data to that XPOutputStream.

Parameters:
c - - the character to be written.

WriteLine

void WriteLine(java.lang.Object o)
This method writes an object followed by an end of line to the client. Either the Write* methods or the GetOutputStream() method may be used to output data, but not both. Calling the Write* methods can be significantly slower than just calling GetOutputStream() once and writing lot's of data to that XPOutputStream.

Parameters:
o - - the object to be written.

WriteLine

void WriteLine(java.lang.String s)
This method writes a string followed by an end of line to the client. Either the Write* methods or the GetOutputStream() method may be used to output data, but not both. Calling the Write* methods can be significantly slower than just calling GetOutputStream() once and writing lot's of data to that XPOutputStream.

Parameters:
s - - the String to be written.

WriteLine

void WriteLine(char[] s)
This method writes an array of characters followed by an end of line to the client. Either the Write* methods or the GetOutputStream() method may be used to output data, but not both. Calling the Write* methods can be significantly slower than just calling GetOutputStream() once and writing lot's of data to that XPOutputStream.

Parameters:
s - - the arry of characters to be written.

ClearUnderlyingObject

void ClearUnderlyingObject()
This method clears all the instance variables to avoid memory leak.



Copyright © 2002, 2003, 2004 Plumtree Software Inc. All Rights Reserved.