|
|||||||||
| Home >> All >> com >> meterware >> [ servletunit overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.meterware.servletunit
Interface InvocationContext

- All Known Implementing Classes:
- InvocationContextImpl
- public interface InvocationContext
An interface which represents the invocation of a servlet.
| Method Summary | |
javax.servlet.Filter |
getFilter()
Returns the current active filter object. |
javax.servlet.FilterChain |
getFilterChain()
Returns the current filter chain. |
com.meterware.httpunit.FrameSelector |
getFrame()
Returns the target frame for the original request. |
javax.servlet.http.HttpServletRequest |
getRequest()
Returns the request to be processed by the servlet or filter. |
javax.servlet.http.HttpServletResponse |
getResponse()
Returns the response which the servlet or filter should modify during its operation. |
javax.servlet.Servlet |
getServlet()
Returns the selected servlet, initialized to provide access to sessions and servlet context information. |
com.meterware.httpunit.WebResponse |
getServletResponse()
Returns the final response from the servlet. |
boolean |
isFilterActive()
Returns true if the current context is a filter, rather than a servlet. |
void |
popRequest()
Removes the top request dispatcher or filter from this context. |
void |
pushFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
Pushes the current filter onto the execution stack and switches to the next filter or the selected servlet. |
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. |
void |
service()
Invokes the current servlet or filter. |
| Method Detail |
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
- Returns the request to be processed by the servlet or filter.
getResponse
public javax.servlet.http.HttpServletResponse getResponse()
- Returns the response which the servlet or filter should modify during its operation.
service
public void service()
throws javax.servlet.ServletException,
java.io.IOException
- Invokes the current servlet or filter.
- Since:
- 1.6
getServlet
public javax.servlet.Servlet getServlet() throws javax.servlet.ServletException
- Returns the selected servlet, initialized to provide access to sessions
and servlet context information. Only valid to call if
isFilterActive()55 returns false.
getServletResponse
public com.meterware.httpunit.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.
getFrame
public com.meterware.httpunit.FrameSelector getFrame()
- Returns the target frame for the original request.
- Since:
- 1.6
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.
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.
popRequest
public void popRequest()
- Removes the top request dispatcher or filter from this context.
isFilterActive
public boolean isFilterActive()
- Returns true if the current context is a filter, rather than a servlet.
- Since:
- 1.6
getFilter
public javax.servlet.Filter getFilter() throws javax.servlet.ServletException
- Returns the current active filter object. Only valid to call if
isFilterActive()55 returns true.- Since:
- 1.6
getFilterChain
public javax.servlet.FilterChain getFilterChain()
- Returns the current filter chain. Only valid to call if
isFilterActive()55 returns true.- Since:
- 1.6
pushFilter
public void pushFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
- Pushes the current filter onto the execution stack and switches to the next filter or the selected servlet.
This can be used to simulate the effect of the doFilter 55 call.
Note: this method specifies javax.servlet.ServletRequest and javax.servlet.ServletResponse because those are the types passed to Filter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)>Filter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)55 ; however, HttpUnit requires the objects to implement javax.servlet.http.HttpServletRequest and javax.servlet.http.HttpServletResponse because they will eventually be passed to an javax.servlet.http.HttpServlet.- Since:
- 1.6
|
|||||||||
| Home >> All >> com >> meterware >> [ servletunit overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC