java.lang.Object
org.apache.cactus.server.AbstractServletContextWrapper
org.apache.cactus.server.ServletContextWrapper
servletunit.struts.StrutsServletContextWrapper
- All Implemented Interfaces:
- javax.servlet.ServletContext
- public class StrutsServletContextWrapper
- extends org.apache.cactus.server.ServletContextWrapper
A wrapper for the ServletContext class. This is used in
CactusStrutsTestCase so that we can retrieve the forward
processed by the ActionServlet and use absolute paths
for Struts resources. This allows us to to use
the ActionServlet as a black box, rather than mimic its
behavior as was previously the case.
| Methods inherited from class org.apache.cactus.server.AbstractServletContextWrapper |
getAttribute, getAttributeNames, getContext, getInitParameter, getInitParameterNames, getLogs, getMajorVersion, getMimeType, getMinorVersion, getNamedDispatcher, getOriginalContext, getRealPath, getServerInfo, getServlet, getServletNames, getServlets, log, log, log, removeAttribute, setAttribute, setInitParameter |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
processRequest
boolean processRequest
dispatchedResource
private java.lang.String dispatchedResource
StrutsServletContextWrapper
public StrutsServletContextWrapper(javax.servlet.ServletContext context)
setProcessRequest
public void setProcessRequest(boolean flag)
getRequestDispatcher
public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
- Description copied from interface:
javax.servlet.ServletContext
- Returns a javax.servlet.RequestDispatcher object that acts
as a wrapper for the resource located at the given path.
A
RequestDispatcher object can be used to forward
a request to the resource or to include the resource in a response.
The resource can be dynamic or static.
The pathname must begin with a "/" and is interpreted as relative
to the current context root. Use getContext to obtain
a RequestDispatcher for resources in foreign contexts.
This method returns null if the ServletContext
cannot return a RequestDispatcher.
getForward
public java.lang.String getForward()
getResource
public java.net.URL getResource(java.lang.String pathname)
throws java.net.MalformedURLException
- Override the getResource method to look for resources in the file system, allowing
the use of absolute paths for Struts configuration files. If the resource path exists
in the file system, this method will return a URL based on the supplied path; otherwise,
it defers to the ServletContext loader.
getResourceAsStream
public java.io.InputStream getResourceAsStream(java.lang.String pathname)
- Override the getResourceAsStream method to look for resources in the file system, allowing
the use of absolute paths for Struts configuration files. If the resource path exists
in the file system, this method will return a URL based on the supplied path; otherwise,
it defers to the ServletContext loader.