public ServletRegistration . Dynamic addServlet ( String name , Servlet servlet ) { final ServletHolder holder = new NonblockingServletHolder ( requireNonNull ( servlet ) ) ; holder . setName ( name ) ; handler . getServletHandler ( ) . addServlet ( holder ) ; final ServletRegistration . Dynamic registration = holder . getRegistration ( ) ; checkDuplicateRegistration ( name , servlets , "servlet" ) ; return registration ; }
Add a servlet instance .