title: Configure RequestMappingHandlerAdapter in java based configuration respective to messageconverter
body: <p>I am developing RestFul web service and I am beginner, I want to configure <code>RequestMappingHandlerAdapter</code> in my java based configuration respective to the below xml based configuration.</p>
  
  <pre><code>&lt;!-- Configure to plugin JSON as request and response in method handler --&gt;
      &lt;beans:bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"&gt;
          &lt;beans:property name="messageConverters"&gt;
              &lt;beans:list&gt;
                  &lt;beans:ref bean="jsonMessageConverter"/&gt;
              &lt;/beans:list&gt;
          &lt;/beans:property&gt;
      &lt;/beans:bean&gt;
  
      &lt;!-- Configure bean to convert JSON to POJO and vice versa --&gt;
      &lt;beans:bean id="jsonMessageConverter" class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"&gt;
      &lt;/beans:bean&gt;
  </code></pre>
  
  <p>And my java based configuration looks like:</p>
  
  <pre><code>@Configuration
  @EnableWebMvc
  @ComponentScan(basePackages = "com.mzk.mascot")
  public class DispatcherServletConfiguration implements WebMvcConfigurer {
      @Bean
      public MappingJackson2HttpMessageConverter converter() {
          MappingJackson2HttpMessageConverter httpMessageConverter = new MappingJackson2HttpMessageConverter();
          return httpMessageConverter;
      }
  
  
  
  @Override
      public void configureMessageConverters(List&lt;HttpMessageConverter&lt;?&gt;&gt; converters) {
          converters.add(converter());
  
      }
    }
  </code></pre>
  
  <p>As per XML i need a equivalent configuration of <code>RequestMappingHandlerAdapter</code></p>