public class EmbedTomcat extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.apache.catalina.startup.Tomcat |
tomcat |
| Constructor and Description |
|---|
EmbedTomcat() |
| Modifier and Type | Method and Description |
|---|---|
static void |
runServlet(javax.servlet.http.HttpServlet servlet,
String workingDir,
String urlPattern,
int port)
Utility to run a webapp in Tomcat - wait and then shut down
|
static void |
runWebApp(String pathname,
String workingDir,
int port)
Utility to run a servlet in Tomcat at the server root address - wait and then shut down
|
static org.apache.catalina.Context |
startTomcat(String servletName,
String urlPattern,
javax.servlet.http.HttpServlet servlet,
int port)
Utility to start Tomcat with the servlet supplied
|
static void |
stopTomcat()
Utility to shut Tomcat down
|
public static org.apache.catalina.Context startTomcat(String servletName, String urlPattern, javax.servlet.http.HttpServlet servlet, int port) throws org.apache.catalina.LifecycleException, IOException
servletName - a nameurlPattern - a mapping for the addresses the servlet will respond toservlet - an instantiated servletorg.apache.catalina.LifecycleExceptionIOExceptionpublic static void stopTomcat()
public static void runWebApp(String pathname, String workingDir, int port) throws org.apache.catalina.LifecycleException
pathname - path to the webapp folder from project rootworkingDir - where Tomcat should put its temp files etcport - the port to listen onorg.apache.catalina.LifecycleExceptionpublic static void runServlet(javax.servlet.http.HttpServlet servlet,
String workingDir,
String urlPattern,
int port)
throws org.apache.catalina.LifecycleException
servlet - a servletworkingDir - where Tomcat should put its temp files etcurlPattern - where servlet should be releative to server rootport - the port to listen onorg.apache.catalina.LifecycleExceptionCopyright © 2022 51Degrees. All rights reserved.