uk.ltd.getahead.dwr
Interface WebContext

All Known Implementing Classes:
DefaultWebContext, ExecutionContext

public interface 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
 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.
 

Method Detail

getContainer

public Container getContainer()
Accessor for the IoC container.

Returns:
The IoC container that created the interface implementations.

getSession

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

Returns:
Returns the http session.
See Also:
HttpServletRequest.getSession()

getSession

public 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. If create is false and the request has no valid HttpSession, this method returns null.

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()
Accessor for the servlet config.

Returns:
Returns the config.

getServletContext

public javax.servlet.ServletContext getServletContext()
Returns the ServletContext to which this session belongs.

Returns:
The servlet context information.

getHttpServletRequest

public javax.servlet.http.HttpServletRequest getHttpServletRequest()
Accessor for the http request information.

Returns:
Returns the request.

getHttpServletResponse

public javax.servlet.http.HttpServletResponse getHttpServletResponse()
Accessor for the http response bean.

Returns:
Returns the response.

forwardToString

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

Parameters:
url - The URL to forward to
Returns:
The text that results from forwarding to the given URL
Throws:
java.io.IOException - if the target resource throws this exception
javax.servlet.ServletException - if the target resource throws this exception
java.lang.IllegalStateException - if the response was already committed

getVersion

public java.lang.String getVersion()
Fish the version number out of the dwr.properties file.

Returns:
The current version number.

Copyright ? 2005