public void visit ( final WebAppServlet webAppServlet ) { NullArgumentException . validateNotNull ( webAppServlet , "Web app servlet" ) ; final String [ ] urlPatterns = webAppServlet . getAliases ( ) ; if ( urlPatterns == null || urlPatterns . length == 0 ) { LOG . warn ( "Servlet [" + webAppServlet + "] does not have any mapping. Skipped." ) ; } try { if ( webAppServlet instanceof WebAppJspServlet ) { webContainer . registerJspServlet ( urlPatterns , httpContext , ( ( WebAppJspServlet ) webAppServlet ) . getJspPath ( ) ) ; } else { Class < ? extends Servlet > servletClass = RegisterWebAppVisitorHS . loadClass ( Servlet . class , bundleClassLoader , webAppServlet . getServletClassName ( ) ) ; webContainer . registerServlet ( servletClass , urlPatterns , RegisterWebAppVisitorHS . convertInitParams ( webAppServlet . getInitParams ( ) ) , webAppServlet . getLoadOnStartup ( ) , webAppServlet . getAsyncSupported ( ) , webAppServlet . getMultipartConfig ( ) , httpContext ) ; } //CHECKSTYLE:OFF } catch ( Exception ignore ) { LOG . error ( REGISTRATION_EXCEPTION_SKIPPING , ignore ) ; } //CHECKSTYLE:ON }
Registers servlets with web container .