uk.ltd.getahead.dwr
Class ExecutionContext

java.lang.Object
  extended byuk.ltd.getahead.dwr.ExecutionContext
All Implemented Interfaces:
WebContext

public class ExecutionContext
extends java.lang.Object
implements WebContext

Class to enable us to access servlet parameters.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Method Summary
 java.lang.String forwardToString(java.lang.String url)
          Forward a request to a given URL and catch the data written to it
static ExecutionContext get()
          Deprecated. Use WebContextFactory.get() for better results
 Container getContainer()
          Accessor for the IoC container.
 javax.servlet.http.HttpServletRequest getHttpServletRequest()
          Accessor for the http request information.
 javax.servlet.http.HttpServletResponse getHttpServletResponse()
          Accessor for the http response bean.
 javax.servlet.ServletConfig getServletConfig()
          Accessor for the servlet config.
 javax.servlet.ServletContext getServletContext()
          Returns the ServletContext to which this session belongs.
 javax.servlet.http.HttpSession getSession()
          Returns the current session associated with this request, or if the request does not have a session, creates one.
 javax.servlet.http.HttpSession getSession(boolean create)
          Returns the current HttpSession associated with this request or, if there is no current session and create is true, returns a new session.
 java.lang.String getVersion()
          Fish the version number out of the dwr.properties file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSession

public javax.servlet.http.HttpSession getSession()
Description copied from interface: WebContext
Returns the current session associated with this request, or if the request does not have a session, creates one.

Specified by:
getSession in interface WebContext
Returns:
Returns the http session.
See Also:
HttpServletRequest.getSession()

getSession

public javax.servlet.http.HttpSession getSession(boolean create)
Description copied from interface: WebContext
Returns the current HttpSession associated with this request or, if there is no current session and create is true, returns a new session. If create is false and the request has no valid HttpSession, this method returns null.

Specified by:
getSession in interface WebContext
Parameters:
create - false to return null if there's no current session
Returns:
the session associated with this request
See Also:
HttpServletRequest.getSession(boolean)

getServletConfig

public javax.servlet.ServletConfig getServletConfig()
Description copied from interface: WebContext
Accessor for the servlet config.

Specified by:
getServletConfig in interface WebContext
Returns:
Returns the config.

getServletContext

public javax.servlet.ServletContext getServletContext()
Description copied from interface: WebContext
Returns the ServletContext to which this session belongs.

Specified by:
getServletContext in interface WebContext
Returns:
The servlet context information.

getHttpServletRequest

public javax.servlet.http.HttpServletRequest getHttpServletRequest()
Description copied from interface: WebContext
Accessor for the http request information.

Specified by:
getHttpServletRequest in interface WebContext
Returns:
Returns the request.

getHttpServletResponse

public javax.servlet.http.HttpServletResponse getHttpServletResponse()
Description copied from interface: WebContext
Accessor for the http response bean.

Specified by:
getHttpServletResponse in interface WebContext
Returns:
Returns the response.

forwardToString

public java.lang.String forwardToString(java.lang.String url)
                                 throws javax.servlet.ServletException,
                                        java.io.IOException
Description copied from interface: WebContext
Forward a request to a given URL and catch the data written to it

Specified by:
forwardToString in interface WebContext
Parameters:
url - The URL to forward to
Returns:
The text that results from forwarding to the given URL
Throws:
javax.servlet.ServletException - if the target resource throws this exception
java.io.IOException - if the target resource throws this exception

getVersion

public java.lang.String getVersion()
Description copied from interface: WebContext
Fish the version number out of the dwr.properties file.

Specified by:
getVersion in interface WebContext
Returns:
The current version number.

getContainer

public Container getContainer()
Description copied from interface: WebContext
Accessor for the IoC container.

Specified by:
getContainer in interface WebContext
Returns:
The IoC container that created the interface implementations.

get

public static ExecutionContext get()
Deprecated. Use WebContextFactory.get() for better results

Accessor for the current ExecutionContext.

Returns:
The current ExecutionContext or null if the current thread was not started by DWR.

Copyright ? 2005