HATS 7.5.1 Web API Reference

Publicly accessible methods not documented here are for IBM internal use only and may change in a future release of the product.

com.ibm.hats.runtime
Interface IResponse

All Known Implementing Classes:
WebResponse

public interface IResponse

Class Name: IResponse
Class Type:
Interface
Base Class:
None
Intf Class:
None
Description:
Provides a generic interface for the implementing response objects.


Field Summary
static String CLASSNAME
          The fully-qualified name of this class.
 
Method Summary
 void addHeader(String name, String value)
          Adds a response header with the given name and value.
 String encodeRedirectURL(String url)
          Encodes the specified URL for sendRedirect.
 String encodeURL(String name)
          Retrieve the specified attribute.
 OutputStream getOutputStream()
          Returns a OutputStream suitable for writing binary data in the response.
 void sendRedirect(String url)
          Sends a temporary redirect response to the client.
 void setContentLength(int i)
          Sets the length of the content body in the response.
 void setContentType(String mimeType)
          Sets the content type of the response being sent to the client,
 void setDateHeader(String name, long date)
          Sets a response header with the given name and date-value.
 void setHeader(String name, String value)
          Sets a response header with the given name and value ¶m name - the name of the header ¶m value - the header value
 

Field Detail

CLASSNAME

static final String CLASSNAME
The fully-qualified name of this class.

Method Detail

encodeURL

String encodeURL(String name)
Retrieve the specified attribute.

Parameters:
name - The name of the attribute being retrieved.
Returns:
The attribute.

encodeRedirectURL

String encodeRedirectURL(String url)
Encodes the specified URL for sendRedirect.

Parameters:
url - URL to encode if necessary.
Returns:
Returns either the encoded URL, or the original URL unchanged.

sendRedirect

void sendRedirect(String url)
                  throws IOException
Sends a temporary redirect response to the client.

Parameters:
url - The redirect location URL.
Throws:
IOException

setDateHeader

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

Parameters:
name - The name of the header to set.
date - The additional date value.

setHeader

void setHeader(String name,
               String value)
Sets a response header with the given name and value ¶m name - the name of the header ¶m value - the header value


addHeader

void addHeader(String name,
               String value)
Adds a response header with the given name and value.

Parameters:
name - The name of the header.
value - The additional header value.

getOutputStream

OutputStream getOutputStream()
                             throws IOException
Returns a OutputStream suitable for writing binary data in the response.

Returns:
An OutputStream for writing binary data.
Throws:
IOException
See Also:
ServletResponse.getOutputStream()

setContentLength

void setContentLength(int i)
Sets the length of the content body in the response.

Parameters:
i - The length of the content body.

setContentType

void setContentType(String mimeType)
Sets the content type of the response being sent to the client,

Parameters:
mimeType - The content type of the response.

HATS 7.5.1 (201005110649)