public class ServletRunner extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ServletRunner.JasperJSPServletDescriptor |
Modifier and Type | Field and Description |
---|---|
static JSPServletDescriptor |
JASPER_DESCRIPTOR |
Constructor and Description |
---|
ServletRunner()
Default constructor, which defines no servlets.
|
ServletRunner(File webXml)
Constructor which expects a File object representing the web.xml for the
application.
|
ServletRunner(File webXml,
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(InputStream webXML)
Constructor which expects an input stream containing the web.xml for the application.
|
ServletRunner(InputStream webXML,
String contextPath)
Constructor which expects an input stream containing the web.xml for the application.
|
ServletRunner(String webXMLFileSpec)
Deprecated.
as of 1.6, use
ServletRunner(File) |
ServletRunner(String webXMLFileSpec,
EntityResolver resolver)
constructor with entity Resolver
as asked for in Bug report 1222269 by jim - jafergus
|
ServletRunner(String webXMLFileSpec,
String contextPath)
Deprecated.
as of 1.6, use
ServletRunner(File,String) |
Modifier and Type | Method and Description |
---|---|
String |
getContextParameter(String name)
Returns the value of the named context parameter found in the application definition.
|
WebResponse |
getResponse(String url)
Returns the response from the specified servlet using GET.
|
WebResponse |
getResponse(WebRequest request)
Returns the response from the specified servlet.
|
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(String resourceName,
String servletClassName)
Registers a servlet class to be run.
|
void |
registerServlet(String resourceName,
String servletClassName,
Hashtable initParameters)
Registers a servlet class to be run, specifying initialization parameters.
|
void |
setContextParameter(String name,
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(String webXMLFileSpec) throws IOException, SAXException
ServletRunner(File)
webXMLFileSpec
- the full path to the web.xml fileIOException
SAXException
public ServletRunner(String webXMLFileSpec, String contextPath) throws IOException, SAXException
ServletRunner(File,String)
webXMLFileSpec
- the full path to the web.xml filecontextPath
- the context pathIOException
SAXException
public ServletRunner(File webXml) throws IOException, SAXException
webXml
- the web.xml fileIOException
SAXException
public ServletRunner(File webXml, String contextPath) throws IOException, SAXException
webXml
- the web.xml filecontextPath
- the context pathIOException
SAXException
public ServletRunner(String webXMLFileSpec, EntityResolver resolver) throws IOException, SAXException
webXMLFileSpec
- resolver
- IOException
SAXException
public ServletRunner(InputStream webXML) throws IOException, SAXException
IOException
SAXException
public ServletRunner(InputStream webXML, String contextPath) throws IOException, SAXException
webXML
- contextPath
- IOException
SAXException
public void registerServlet(String resourceName, String servletClassName)
public void registerServlet(String resourceName, String servletClassName, Hashtable initParameters)
public WebResponse getResponse(WebRequest request) throws MalformedURLException, IOException, SAXException
SAXException
- thrown if there is an error parsing the responseMalformedURLException
IOException
public WebResponse getResponse(String url) throws MalformedURLException, IOException, SAXException
SAXException
- thrown if there is an error parsing the responseMalformedURLException
IOException
public javax.servlet.http.HttpSession getSession(boolean create)
create
- if true, will create a new session if no valid session is defined.public String getContextParameter(String name)
name
- - the name of the parameter to getpublic void setContextParameter(String name, Object value)
name
- - the name of the parameter to setvalue
- - the value of the parameter to setpublic void shutDown()
public ServletUnitClient newClient()
Copyright © 2012. All Rights Reserved.