use of javax.servlet.Servlet in project tomee by apache.
the class HttpUtil method removeServlet.
public static void removeServlet(final String mapping, final WebContext wc) {
final HttpListenerRegistry registry = SystemInstance.get().getComponent(HttpListenerRegistry.class);
if (registry == null || mapping == null) {
return;
}
final Servlet servlet = ((ServletListener) registry.removeHttpListener(pattern(wc.getContextRoot(), mapping))).getDelegate();
servlet.destroy();
wc.destroy(servlet);
if (servlet.getClass().equals("org.apache.jasper.servlet.JspServlet")) {
SystemInstance.get().getComponent(ServletContext.class).removeAttribute("org.apache.tomcat.InstanceManager");
}
}
Aggregations