public StandardWrapper addServlet(String path, String name, String clazz) throws ServletException { StandardWrapper servlet = (StandardWrapper) rootContext.createWrapper(); servlet.setName(name); servlet.setServletClass(clazz); servlet.setLoadOnStartup(1); rootContext.addChild(servlet); rootContext.addServletMapping(path, name); servlet.setParent(rootContext); // servlet.load(); return servlet; }