com.meterware.servletunit
Interface InvocationContext


public interface InvocationContext

An interface which represents the invocation of a servlet.

Author:
Russell Gold

Method Summary
 javax.servlet.http.HttpServletRequest getRequest()
          Returns the request to be processed by the servlet.
 javax.servlet.http.HttpServletResponse getResponse()
          Returns the response which the servlet should modify during its operation.
 javax.servlet.Servlet getServlet()
          Returns the selected servlet, initialized to provide access to sessions and servlet context information.
 WebResponse getServletResponse()
          Returns the final response from the servlet.
 java.lang.String getTarget()
          Returns the target for the original request.
 void popRequest()
          Removes the top request dispatcher from this context.
 void pushForwardRequest(javax.servlet.RequestDispatcher rd, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Adds a request dispatcher to this context to simulate a forward request.
 void pushIncludeRequest(javax.servlet.RequestDispatcher rd, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Adds a request dispatcher to this context to simulate an include request.
 

Method Detail

getRequest

public javax.servlet.http.HttpServletRequest getRequest()
Returns the request to be processed by the servlet.


getResponse

public javax.servlet.http.HttpServletResponse getResponse()
Returns the response which the servlet should modify during its operation.


getServlet

public javax.servlet.Servlet getServlet()
                                 throws javax.servlet.ServletException
Returns the selected servlet, initialized to provide access to sessions and servlet context information.

Throws:
javax.servlet.ServletException

getServletResponse

public WebResponse getServletResponse()
                               throws java.io.IOException
Returns the final response from the servlet. Note that this method should only be invoked after all processing has been done to the servlet response.

Throws:
java.io.IOException

getTarget

public java.lang.String getTarget()
Returns the target for the original request.


pushIncludeRequest

public void pushIncludeRequest(javax.servlet.RequestDispatcher rd,
                               javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response)
                        throws javax.servlet.ServletException
Adds a request dispatcher to this context to simulate an include request.

Throws:
javax.servlet.ServletException

pushForwardRequest

public void pushForwardRequest(javax.servlet.RequestDispatcher rd,
                               javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response)
                        throws javax.servlet.ServletException
Adds a request dispatcher to this context to simulate a forward request.

Throws:
javax.servlet.ServletException

popRequest

public void popRequest()
Removes the top request dispatcher from this context.


Copyright © 2000-2003 Russell Gold. See license agreement for rights granted.