title: Need help converting from web.xml spring boot
body: <p>I am trying to convert a web.xml based web app to spring boot but am having trouble configuring an HttpRequestHandlerServlet.  I have the following in my web.xml:</p>
  
  <pre><code>&lt;servlet&gt;
    &lt;servlet-name&gt;webServices&lt;/servlet-name&gt;
    &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
  &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet&gt;
    &lt;servlet-name&gt;updateServlet&lt;/servlet-name&gt;
    &lt;servlet-class&gt;org.springframework.web.context.support.HttpRequestHandlerServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;updateServlet&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/update&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;webServices&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/ws/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>The DispatcherServlet was not a problem:</p>
  
  <pre><code>@SpringBootApplication
  public class WebApplication extends SpringBootServletInitializer
  {
    public static void main(String[] args)
    {
      SpringApplication.run(PoolWebApplication.class);
    }
  
    @Bean
    public DispatcherServlet dispatcherServlet()
    {
      return new DispatcherServlet();
    }
  
    @Bean
    public ServletRegistrationBean servletRegistrationBean()
    {
      return new ServletRegistrationBean(dispatcherServlet(), "/ws/*");
    }
  }
  </code></pre>
  
  <p>But I can't figure out how to configure updateServlet.</p>
  
  <p>How does one configure an HttpRequestHandlerServlet based servlet in a Spring Boot application?</p>
  
  <p>Additional Info:</p>
  
  <p>I tried the suggested answer but it doesn't work for me.</p>
  
  <p>One thing that I didn't mention is that UpdateServlet is named "updateServlet":
      Componenet("updateServlet")
      public class UpdateServlet implements HttpRequestHandler</p>
  
  <p>That name conflicts with the bean name in the answer.  After changing it (to update), I get:</p>
  
  <pre><code>No bean named 'httpRequestHandlerServlet' is defined
  </code></pre>
  
  <p>After changing the name of updateServlet to httpRequestHandlerServlet, I get</p>
  
  <pre><code>org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'httpRequestHandlerServlet' must be of type [org.springframework.web.HttpRequestHandler], but was actually of type [org.springframework.web.context.support.HttpRequestHandlerServlet]
  </code></pre>