Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | 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

static 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 71 of file ServletResponse.d.

void reset  )  [inline]
 

Reset this response, ready for the next connection

Reimplemented from HttpResponse.

Definition at line 81 of file ServletResponse.d.

HttpMutableParams getParameters  )  [inline]
 

Reimplemented from IServletResponse.

Definition at line 91 of file ServletResponse.d.

HttpMutableCookies getCookies  )  [inline]
 

Reimplemented from IServletResponse.

Definition at line 100 of file ServletResponse.d.

HttpMutableHeaders getHeaders  )  [inline]
 

Reimplemented from IServletResponse.

Definition at line 109 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 118 of file ServletResponse.d.

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

void setContentLength int  len  )  [inline]
 

Reimplemented from IServletResponse.

Definition at line 127 of file ServletResponse.d.

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

Referenced by copyFile().

void setContentType char[]  type  )  [inline]
 

Reimplemented from IServletResponse.

Definition at line 137 of file ServletResponse.d.

void flushBuffer  )  [inline]
 

Reimplemented from IServletResponse.

Definition at line 146 of file ServletResponse.d.

References getWriter().

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 160 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 175 of file ServletResponse.d.

void sendRedirect char[]  location  )  [inline]
 

Send a redirect response to the user-agent

Reimplemented from HttpResponse.

Definition at line 185 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 199 of file ServletResponse.d.

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

Reimplemented from IServletResponse.

Definition at line 208 of file ServletResponse.d.

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

static this  )  [inline, static, inherited]
 

Construct static instances of exceptions etc.

Definition at line 201 of file HttpResponse.d.

References HttpResponse::InvalidState.

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 103 of file HttpMessage.d.

References HttpMessage::bridge, Buffer, HttpMessage::buffer, and HttpMessage::headers.

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 282 of file HttpResponse.d.

References HttpResponse::sendError().

HttpStatus getStatus  )  [inline, inherited]
 

Return the current response status

Definition at line 304 of file HttpResponse.d.

References HttpResponse::status.

HttpMutableParams getOutputParams  )  [inline, inherited]
 

Return the wrapper for adding output parameters

Definition at line 331 of file HttpResponse.d.

References HttpResponse::params.

HttpMutableCookies getOutputCookies  )  [inline, inherited]
 

Return the wrapper for output cookies

Definition at line 342 of file HttpResponse.d.

References HttpResponse::cookies.

HttpMutableHeaders getOutputHeaders  )  [inline, inherited]
 

Return the wrapper for output headers.

Definition at line 353 of file HttpResponse.d.

References HttpResponse::commited, and HttpResponse::InvalidState.

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 369 of file HttpResponse.d.

References HttpResponse::commit(), and HttpResponse::writer.

void write IWriter  writer  )  [inline, inherited]
 

Write the response and the output headers

Reimplemented from HttpMessage.

Definition at line 396 of file HttpResponse.d.

References HttpResponse::commit().

void flush IWriter  writer  )  [inline, inherited]
 

Ensure the output is flushed

Definition at line 407 of file HttpResponse.d.

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

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


The documentation for this class was generated from the following file:
Generated on Fri May 27 18:12:03 2005 for Mango by  doxygen 1.4.0