*
* TODO: add the rest
*
- * @param contextPath "/" for root context.
+ * @param contextPath "" for root context.
* @param baseDir base dir for the context, for static files. Must exist,
* relative to the server home
*/
fail("Unable to create foo directory in docBase");
}
- Context ctx = tomcat.addContext("/", docBase.getAbsolutePath());
+ Context ctx = tomcat.addContext("", docBase.getAbsolutePath());
Tomcat.addServlet(ctx, "servlet", new PathParamServlet());
ctx.addServletMapping("/", "servlet");
// Must have a real docBase - just use temp
Context ctx =
- tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+ tomcat.addContext("", System.getProperty("java.io.tmpdir"));
Tomcat.addServlet(ctx, "servlet", new PathParamServlet());
ctx.addServletMapping("/", "servlet");
// Must have a real docBase - just use temp
Context ctx =
- tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+ tomcat.addContext("", System.getProperty("java.io.tmpdir"));
// Add the Servlet
Tomcat.addServlet(ctx, "servlet", new EchoQueryStringServlet());
// Must have a real docBase - just use temp
Context ctx =
- tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+ tomcat.addContext("", System.getProperty("java.io.tmpdir"));
LoginConfig config = new LoginConfig();
config.setAuthMethod("BASIC");
// Must have a real docBase - just use temp
File docBase = new File(System.getProperty("java.io.tmpdir"));
- Context ctx = tomcat.addContext("/", docBase.getAbsolutePath());
+ Context ctx = tomcat.addContext("", docBase.getAbsolutePath());
Tomcat.addServlet(ctx, "servlet", new Bug49598Servlet());
ctx.addServletMapping("/", "servlet");
// Must have a real docBase - just use temp
Context ctx =
- tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+ tomcat.addContext("", System.getProperty("java.io.tmpdir"));
Bug49528Servlet servlet = new Bug49528Servlet();
// Must have a real docBase - just use temp
Context ctx =
- tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+ tomcat.addContext("", System.getProperty("java.io.tmpdir"));
Bug49567Servlet servlet = new Bug49567Servlet();
// Must have a real docBase - just use temp
Context ctx =
- tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+ tomcat.addContext("", System.getProperty("java.io.tmpdir"));
AsyncStartNoCompleteServlet servlet =
new AsyncStartNoCompleteServlet();
// Must have a real docBase - just use temp
Context ctx =
- tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+ tomcat.addContext("", System.getProperty("java.io.tmpdir"));
AsyncStartWithCompleteServlet servlet =
new AsyncStartWithCompleteServlet();
fail("Unable to create async directory in docBase");
}
- Context ctx = tomcat.addContext("/", docBase.getAbsolutePath());
+ Context ctx = tomcat.addContext("", docBase.getAbsolutePath());
TimeoutServlet timeout = new TimeoutServlet();
// Must have a real docBase - just use temp
org.apache.catalina.Context ctx =
- tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+ tomcat.addContext("", System.getProperty("java.io.tmpdir"));
// Enable JNDI - it is disabled by default
tomcat.enableNaming();
// Must have a real docBase - just use temp
StandardContext ctx = (StandardContext)
- tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+ tomcat.addContext("", System.getProperty("java.io.tmpdir"));
File lib = new File("webapps/examples/WEB-INF/lib");
ctx.setAliases("/WEB-INF/lib=" + lib.getCanonicalPath());
// Must have a real docBase - just use temp
Context ctx =
- tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+ tomcat.addContext("", System.getProperty("java.io.tmpdir"));
// Add the Servlet
CharsetServlet servlet = new CharsetServlet(mode);
File appDir = new File("test/webapp-3.0");
// Must have a real docBase - just use temp
StandardContext ctx =
- (StandardContext)tomcat.addContext("/", appDir.getAbsolutePath());
+ (StandardContext)tomcat.addContext("", appDir.getAbsolutePath());
VirtualWebappLoader loader = new VirtualWebappLoader();
// Must have a real docBase - just use temp
Context ctx =
- tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+ tomcat.addContext("", System.getProperty("java.io.tmpdir"));
if (ctx instanceof StandardContext) {
((StandardContext) ctx).setClearReferencesStopTimerThreads(true);
// Must have a real docBase - just use temp
org.apache.catalina.Context ctx =
- tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+ tomcat.addContext("", System.getProperty("java.io.tmpdir"));
// You can customize the context by calling
// its API
// Must have a real docBase - just use temp
org.apache.catalina.Context ctx =
- tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+ tomcat.addContext("", System.getProperty("java.io.tmpdir"));
// You can customise the context by calling its API
// Must have a real docBase - just use temp
org.apache.catalina.Context ctx =
- tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+ tomcat.addContext("", System.getProperty("java.io.tmpdir"));
// You can customise the context by calling its API
// Must have a real docBase - just use temp
StandardContext ctx = (StandardContext)
- tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+ tomcat.addContext("", System.getProperty("java.io.tmpdir"));
ctx.setCacheTTL(500);
tomcat.start();
public static void addServlets(Tomcat tomcat) {
// Must have a real docBase - just use temp
Context ctx =
- tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+ tomcat.addContext("", System.getProperty("java.io.tmpdir"));
Tomcat.addServlet(ctx, "invalid", new CookieServlet("na;me", "value"));
ctx.addServletMapping("/invalid", "invalid");
public static void addServlets(Tomcat tomcat) {
// Must have a real docBase - just use temp
Context ctx =
- tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
+ tomcat.addContext("", System.getProperty("java.io.tmpdir"));
Tomcat.addServlet(ctx, path, new TestBug49158Servlet());
ctx.addServletMapping("/"+path, path);