Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

ServletResponse Class Reference

Inheritance diagram for ServletResponse:

HttpResponse IServletResponse List of all members.

Public Member Functions

 this (IProviderBridge bridge)
void reset ()
HttpMutableParams getParameters ()
HttpMutableCookies getCookies ()
HttpMutableHeaders getHeaders ()
HttpWriter getWriter ()
void setContentLength (int len)
void setContentType (char[] type)
void flushBuffer ()
void sendError (inout HttpStatus status, char[] msg)
void sendError (inout HttpStatus status)
void sendRedirect (char[] location)
void setStatus (inout HttpStatus status)
bool copyFile (ServletContext context, char[] path)

Private Member Functions

 this (IProviderBridge bridge, IBuffer headerSpace)
void sendError (inout HttpStatus status, Exception ex)
HttpStatus getStatus ()
HttpMutableParams getOutputParams ()
HttpMutableCookies getOutputCookies ()
HttpMutableHeaders getOutputHeaders ()
IBuffer getOutputBuffer ()
void write (IWriter writer)
void flush (IWriter writer)

Static Private Member Functions

 this ()

Member Function Documentation

this IProviderBridge  bridge  )  [inline]
 

Create a Response instance. Note that we create a bunch of internal support objects on a per-thread basis. This is so we don't have to create them on demand; however, we should be careful about resetting them all before each new usage.

Reimplemented from HttpResponse.

Definition at line 68 of file ServletResponse.d.

void reset  )  [inline]
 

Reset this response, ready for the next connection

Reimplemented from HttpResponse.

Definition at line 78 of file ServletResponse.d.

HttpMutableParams getParameters  )  [inline]
 

Reimplemented from IServletResponse.

Definition at line 88 of file ServletResponse.d.

HttpMutableCookies getCookies  )  [inline]
 

Reimplemented from IServletResponse.

Definition at line 97 of file ServletResponse.d.

HttpMutableHeaders getHeaders  )  [inline]
 

Reimplemented from IServletResponse.

Definition at line 106 of file ServletResponse.d.

HttpWriter getWriter  )  [inline]
 

Return the output writer. This set a sentinel indicating that we cannot add any more headers (since they have to be flushed before any additional output is sent).

Reimplemented from HttpResponse.

Definition at line 115 of file ServletResponse.d.

Referenced by ServletProvider::service().

void setContentLength int  len  )  [inline]
 

Reimplemented from IServletResponse.

Definition at line 124 of file ServletResponse.d.

References HttpMutableHeaders::addInt(), and HttpMessage::getHeader().

Referenced by copyFile().

void setContentType char[]  type  )  [inline]
 

Reimplemented from IServletResponse.

Definition at line 134 of file ServletResponse.d.

void flushBuffer  )  [inline]
 

Reimplemented from IServletResponse.

Definition at line 143 of file ServletResponse.d.

void sendError inout HttpStatus  status,
char[]  msg
[inline]
 

The argument 'status' should be "inout" instead so as to enforce pass-by-reference semantics. However, one cannot do that with a const struct. D apparently still requires further development in this area.

Reimplemented from HttpResponse.

Definition at line 157 of file ServletResponse.d.

Referenced by copyFile(), and ServletProvider::service().

void sendError inout HttpStatus  status  )  [inline]
 

The argument 'status' should be "inout" instead so as to enforce pass-by-reference semantics. However, one cannot do that with a const struct. D apparently still requires further development in this area.

Reimplemented from HttpResponse.

Definition at line 172 of file ServletResponse.d.

void sendRedirect char[]  location  )  [inline]
 

Send a redirect response to the user-agent

Reimplemented from HttpResponse.

Definition at line 182 of file ServletResponse.d.

void setStatus inout HttpStatus  status  )  [inline]
 

The argument 'status' should be "inout" instead so as to enforce pass-by-reference semantics. However, one cannot do that with a const struct. D apparently still requires further development in this area.

Reimplemented from HttpResponse.

Definition at line 196 of file ServletResponse.d.

bool copyFile ServletContext  context,
char[]  path
[inline]
 

Reimplemented from IServletResponse.

Definition at line 205 of file ServletResponse.d.

References FilePath::getExtension(), ServletContext::getMimeType(), FileConduit::getPath(), ServletContext::getResourceAsFile(), FileConduit::length(), sendError(), and setContentLength().

this  )  [inline, static, inherited]
 

Construct static instances of exceptions etc.

Definition at line 198 of file HttpResponse.d.

this IProviderBridge  bridge,
IBuffer  headerSpace
[inline, inherited]
 

Construct this HttpMessage using the specified HttpBridge. The bridge provides a gateway to both the server and provider (servicer) instances.

Definition at line 100 of file HttpMessage.d.

References HttpMessage::bridge, and Buffer.

void sendError inout HttpStatus  status,
Exception  ex
[inline, inherited]
 

Send an error status to the user-agent, along with the provided exception text

Definition at line 279 of file HttpResponse.d.

References HttpResponse::sendError().

HttpStatus getStatus  )  [inline, inherited]
 

Return the current response status

Definition at line 301 of file HttpResponse.d.

HttpMutableParams getOutputParams  )  [inline, inherited]
 

Return the wrapper for adding output parameters

Definition at line 328 of file HttpResponse.d.

HttpMutableCookies getOutputCookies  )  [inline, inherited]
 

Return the wrapper for output cookies

Definition at line 339 of file HttpResponse.d.

HttpMutableHeaders getOutputHeaders  )  [inline, inherited]
 

Return the wrapper for output headers.

Definition at line 350 of file HttpResponse.d.

References HttpResponse::commited.

IBuffer getOutputBuffer  )  [inline, inherited]
 

Return the buffer attached to the output conduit. Note that further additions to the output headers is disabled from this point forward.

Definition at line 366 of file HttpResponse.d.

References HttpResponse::commit().

void write IWriter  writer  )  [inline, inherited]
 

Write the response and the output headers

Reimplemented from HttpMessage.

Definition at line 393 of file HttpResponse.d.

References HttpResponse::commit().

void flush IWriter  writer  )  [inline, inherited]
 

Ensure the output is flushed

Definition at line 404 of file HttpResponse.d.

References HttpResponse::commit(), IWriter::flush(), and version.

Referenced by HttpResponse::sendError(), HttpResponse::sendRedirect(), and ServletProvider::service().


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 19:07:10 2004 for Mango by doxygen 1.3.6