code: @Override
      public void registerServlet(String alias, Servlet servlet, Dictionary initparams, HttpContext context) throws ServletException, NamespaceException {
          if (servlet == null) {
              throw new IllegalArgumentException("Servlet must not be null");
          }
          if (!isAliasValid(alias)) {
              throw new IllegalArgumentException("Malformed servlet alias [" + alias + "]");
          }
  
          ServletHandler handler = new ServletHandler(getServletContext(context), servlet, alias);
          handler.setInitParams(initparams);
          synchronized (servletLock) {
              container.getHandlerRegistry().addServlet(handler);
              this.localServlets.add(servlet);
          }
      }
docs: {@inheritDoc}