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

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


GetOutputStream

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

Returns:
OutputStream wrapped in XPOutputStream object

GetCharacterEncoding

public 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

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


SetContentType

public 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

public 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

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

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

EncodeRedirectURL

public 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

public 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

public 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

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

Parameters:
sc - - the status code.

SetStatus

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

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



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