public class ServletRunner
extends java.lang.Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
ServletRunner.JasperJSPServletDescriptor |
| Modifier and Type | Field | Description |
|---|---|---|
static JSPServletDescriptor |
JASPER_DESCRIPTOR |
| Constructor | Description |
|---|---|
ServletRunner() |
Default constructor, which defines no servlets.
|
ServletRunner(java.io.File webXml) |
Constructor which expects a File object representing the web.xml for the
application.
|
ServletRunner(java.io.File webXml,
java.lang.String contextPath) |
Constructor which expects a File object representing the web.xml for the
application and a context path under which to mount it.
|
ServletRunner(java.io.InputStream webXML) |
Constructor which expects an input stream containing the web.xml for the application.
|
ServletRunner(java.io.InputStream webXML,
java.lang.String contextPath) |
Constructor which expects an input stream containing the web.xml for the application.
|
ServletRunner(java.lang.String webXMLFileSpec) |
Deprecated.
as of 1.6, use
ServletRunner(File) |
ServletRunner(java.lang.String webXMLFileSpec,
java.lang.String contextPath) |
Deprecated.
as of 1.6, use
ServletRunner(File,String) |
ServletRunner(java.lang.String webXMLFileSpec,
org.xml.sax.EntityResolver resolver) |
constructor with entity Resolver
as asked for in Bug report 1222269 by jim - jafergus
|
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.String |
getContextParameter(java.lang.String name) |
Returns the value of the named context parameter found in the application definition.
|
WebResponse |
getResponse(WebRequest request) |
Returns the response from the specified servlet.
|
WebResponse |
getResponse(java.lang.String url) |
Returns the response from the specified servlet using GET.
|
javax.servlet.http.HttpSession |
getSession(boolean create) |
Returns the session to be used by the next request.
|
ServletUnitClient |
newClient() |
Creates and returns a new web client that communicates with this servlet runner.
|
void |
registerServlet(java.lang.String resourceName,
java.lang.String servletClassName) |
Registers a servlet class to be run.
|
void |
registerServlet(java.lang.String resourceName,
java.lang.String servletClassName,
java.util.Hashtable initParameters) |
Registers a servlet class to be run, specifying initialization parameters.
|
void |
setContextParameter(java.lang.String name,
java.lang.Object value) |
Deprecated.
- test case for this function deactivated wf 2007-12-30
|
void |
shutDown() |
Shuts down the servlet container, returning any resources held by it.
|
public static final JSPServletDescriptor JASPER_DESCRIPTOR
public ServletRunner()
public ServletRunner(java.lang.String webXMLFileSpec)
throws java.io.IOException,
org.xml.sax.SAXException
ServletRunner(File)webXMLFileSpec - the full path to the web.xml filejava.io.IOExceptionorg.xml.sax.SAXExceptionpublic ServletRunner(java.lang.String webXMLFileSpec,
java.lang.String contextPath)
throws java.io.IOException,
org.xml.sax.SAXException
ServletRunner(File,String)webXMLFileSpec - the full path to the web.xml filecontextPath - the context pathjava.io.IOExceptionorg.xml.sax.SAXExceptionpublic ServletRunner(java.io.File webXml)
throws java.io.IOException,
org.xml.sax.SAXException
webXml - the web.xml filejava.io.IOExceptionorg.xml.sax.SAXExceptionpublic ServletRunner(java.io.File webXml,
java.lang.String contextPath)
throws java.io.IOException,
org.xml.sax.SAXException
webXml - the web.xml filecontextPath - the context pathjava.io.IOExceptionorg.xml.sax.SAXExceptionpublic ServletRunner(java.lang.String webXMLFileSpec,
org.xml.sax.EntityResolver resolver)
throws java.io.IOException,
org.xml.sax.SAXException
webXMLFileSpec - resolver - java.io.IOExceptionorg.xml.sax.SAXExceptionpublic ServletRunner(java.io.InputStream webXML)
throws java.io.IOException,
org.xml.sax.SAXException
java.io.IOExceptionorg.xml.sax.SAXExceptionpublic ServletRunner(java.io.InputStream webXML,
java.lang.String contextPath)
throws java.io.IOException,
org.xml.sax.SAXException
webXML - contextPath - java.io.IOExceptionorg.xml.sax.SAXExceptionpublic void registerServlet(java.lang.String resourceName,
java.lang.String servletClassName)
public void registerServlet(java.lang.String resourceName,
java.lang.String servletClassName,
java.util.Hashtable initParameters)
public WebResponse getResponse(WebRequest request) throws java.net.MalformedURLException, java.io.IOException, org.xml.sax.SAXException
org.xml.sax.SAXException - thrown if there is an error parsing the responsejava.net.MalformedURLExceptionjava.io.IOExceptionpublic WebResponse getResponse(java.lang.String url) throws java.net.MalformedURLException, java.io.IOException, org.xml.sax.SAXException
org.xml.sax.SAXException - thrown if there is an error parsing the responsejava.net.MalformedURLExceptionjava.io.IOExceptionpublic javax.servlet.http.HttpSession getSession(boolean create)
create - if true, will create a new session if no valid session is defined.public java.lang.String getContextParameter(java.lang.String name)
name - - the name of the parameter to getpublic void setContextParameter(java.lang.String name,
java.lang.Object value)
name - - the name of the parameter to setvalue - - the value of the parameter to setpublic void shutDown()
public ServletUnitClient newClient()