Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## nextapp.echo2.webrender
Class Connection

    java.lang.Object
      nextapp.echo2.webrender.Connection

    public class Connection

extends java.lang.Object

A representation of a connection to the server by the client, encapsulating the servlet request and response objects, and providing access to the relevant application instance. `Connection`s also manage the life-cycle of `UserInstance`s within the `HttpSession`.

Method Summary
`WebRenderAction` | `getAction()` Returns the `WebRenderAction` wrapped by this `Connection`.
`WebRenderActionForm` | `getFormBean()` Returns the `WebRenderActionForm` wrapped by this `Connection`.
`java.io.OutputStream` | `getOutputStream()` Returns the `OutputStream` object that may be used to generate a response.
`java.lang.Object` | `getProperty(java.lang.String key)` Returns a property from the `Connection`-persistent property map.
`HttpServletRequest` | `getRequest()` Returns the `HttpServletRequest` wrapped by this `Connection`.
`HttpServletResponse` | `getResponse()` Returns the `HttpServletResponse` wrapped by this `Connection`.
`ActionServlet` | `getServlett()` Returns the `ActionServlet` wrapped by this `Connection`.
`UserInstance` | `getUserInstance()` Returns the `UserInstance` associated with this connection.
`java.io.PrintWriter` | `getWriter()` Returns the `PrintWriter` object that may be used to generate a response.
`void` | `setContentType(ContentType contentType)` Sets the content type of the response.
`void` | `setProperty(java.lang.String key, java.lang.Object value)` Sets a property inthe `Connection`-persistent property map.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getOutputStream

    public java.io.OutputStream getOutputStream()

  Returns the `OutputStream` object that may be used to generate a response. This method may be called once. If it is called, the getPrintWriter() method may not be called. This method wraps a call to `HttpServletResponse.getOutputStream()`. The `OutputStream` will be closed by the servlet container.

  Returns:
    the `OutputStream` object that may be used to generate a response to the client

### getProperty

    public java.lang.Object getProperty(java.lang.String key)

  Returns a property from the `Connection`-persistent property map. (Properties are disposed of when `Connection` has completed).

  Parameters:
    `key` - the property key (for namespacing purposes, keys should be prefaced with the full class name of the object setting the property)
  Returns:
    the property value

### getRequest

    public HttpServletRequest getRequest()

  Returns the `HttpServletRequest` wrapped by this `Connection`.

  Returns:
    the `HttpServletRequest` wrapped by this `Connection`

### getResponse

    public HttpServletResponse getResponse()

  Returns the `HttpServletResponse` wrapped by this `Connection`.

  Returns:
    the `HttpServletResponse` wrapped by this `Connection`

### getServlett

    public ActionServlet getServlett()

  Returns the `ActionServlet` wrapped by this `Connection`.

  Returns:
    the `ActionServlet` wrapped by this `Connection`

### getAction

    public WebRenderAction getAction()

  Returns the `WebRenderAction` wrapped by this `Connection`.

  Returns:
    the `Action` wrapped by this `Connection`

### getFormBean

    public WebRenderActionForm getFormBean()

  Returns the `WebRenderActionForm` wrapped by this `Connection`.

  Returns:
    the `WebRenderActionForm` wrapped by this `Connection`

### getUserInstance

    public UserInstance getUserInstance()

  Returns the `UserInstance` associated with this connection. If the session has not been initialized, null is returned.

  Returns:
    the `UserInstance` associated with this connection

### getWriter

    public java.io.PrintWriter getWriter()

  Returns the `PrintWriter` object that may be used to generate a response. This method may be called once. If it is called, the getOuputStream() method may not be called. This method wraps a call to `HttpServletResponse.getWriter()`. The `PrintWriter` will be closed by the servlet container.

  Returns:
    the `PrintWriter` object that may be used to generate a response to the client

### setContentType

    public void setContentType(ContentType contentType)

  Sets the content type of the response. This method will automatically append a character encoding to non-binary content types.

  Parameters:
    `contentType` - the content type of the response

### setProperty

    public void setProperty(java.lang.String key,
                            java.lang.Object value)

  Sets a property inthe `Connection`-persistent property map. (Properties are disposed of when `Connection` has completed).

  Parameters:
    `key` - the property key (for namespacing purposes, keys should be prefaced with the full class name of the object setting the property)
    `value` - the new property value

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD