ServletHandler handler = new ServletHandler();
Class servletClass = servletClassName == null ?
EmbeddedServletClient.class : Class.forName(servletClassName);
ServletHolder holder = new ServletHolder(servletClass);
handler.addServletWithMapping(holder, "/*");
holder.setInitParameter("application", appName);
// holder.setInitParameter("mountpoint", mountpoint);
if (cookieDomain != null) {
holder.setInitParameter("cookieDomain", cookieDomain);
}
if (sessionCookieName != null) {
holder.setInitParameter("sessionCookieName", sessionCookieName);
}
if (protectedSessionCookie != null) {
holder.setInitParameter("protectedSessionCookie", protectedSessionCookie);
}
if (uploadLimit != null) {
holder.setInitParameter("uploadLimit", uploadLimit);
}
if (uploadSoftfail != null) {
holder.setInitParameter("uploadSoftfail", uploadSoftfail);
}
if (debug != null) {
holder.setInitParameter("debug", debug);
}
appContext.setHandler(handler);
if (protectedStaticDir != null) {