title: AnnotationMethodHandlerAdapterConfigurer has been replaced by RequestMappingHandlerAdapter how can use?
body: <p>i have </p>
  
  <pre><code>import org.apache.commons.lang.ArrayUtils;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.http.converter.HttpMessageConverter;
  import org.springframework.util.PathMatcher;
  import org.springframework.web.bind.support.WebArgumentResolver;
  import org.springframework.web.bind.support.WebBindingInitializer;
  import org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter;
  import org.springframework.web.servlet.mvc.annotation.ModelAndViewResolver;
  import org.springframework.web.servlet.mvc.multiaction.MethodNameResolver;
  import org.springframework.web.util.UrlPathHelper;
  
  
  public class AnnotationMethodHandlerAdapterConfigurer {
  
      @Autowired
      private AnnotationMethodHandlerAdapter adapter;
  
      private WebBindingInitializer webBindingInitializer;
  
      private HttpMessageConverter[] messageConverters;
      private PathMatcher pathMatcher;
      private UrlPathHelper urlPathHelper;
      private MethodNameResolver methodNameResolver;
      private WebArgumentResolver[] customArgumentResolvers;
      private ModelAndViewResolver[] customModelAndViewResolvers;
  
      private boolean replaceMessageConverters = false;
  
      public void init() {
          if (webBindingInitializer != null) {
              adapter.setWebBindingInitializer(webBindingInitializer);
          }
  
          if (messageConverters != null) {
              if (replaceMessageConverters) {
                  adapter.setMessageConverters(messageConverters);
              } else {
                  adapter.setMessageConverters(mergeMessageConverters());
              }
          }
  
          if (pathMatcher != null) {
              adapter.setPathMatcher(pathMatcher);
          }
  
          if (urlPathHelper != null) {
              adapter.setUrlPathHelper(urlPathHelper);
          }
  
          if (methodNameResolver != null) {
              adapter.setMethodNameResolver(methodNameResolver);
          }
  
          if (customArgumentResolvers != null) {
              adapter.setCustomArgumentResolvers(customArgumentResolvers);
          }
  
          if (customModelAndViewResolvers != null) {
              adapter.setCustomModelAndViewResolvers(customModelAndViewResolvers);
          }
      }
  
      private HttpMessageConverter[] mergeMessageConverters() {
          return (HttpMessageConverter[]) ArrayUtils.addAll(messageConverters, adapter.getMessageConverters());
      }
  
      public void setWebBindingInitializer(WebBindingInitializer webBindingInitializer) {
          this.webBindingInitializer = webBindingInitializer;
      }
  
      public void setPathMatcher(PathMatcher pathMatcher) {
          this.pathMatcher = pathMatcher;
      }
  
      public void setUrlPathHelper(UrlPathHelper urlPathHelper) {
          this.urlPathHelper = urlPathHelper;
      }
  
      public void setMethodNameResolver(MethodNameResolver methodNameResolver) {
          this.methodNameResolver = methodNameResolver;
      }
  
      public void setCustomArgumentResolver(WebArgumentResolver argumentResolver) {
          this.customArgumentResolvers = new WebArgumentResolver[] { argumentResolver };
      }
  
      public void setCustomArgumentResolvers(WebArgumentResolver[] argumentResolvers) {
          this.customArgumentResolvers = argumentResolvers;
      }
  
      public void setCustomModelAndViewResolver(ModelAndViewResolver customModelAndViewResolver) {
          this.customModelAndViewResolvers = new ModelAndViewResolver[] { customModelAndViewResolver };
      }
  
      public void setCustomModelAndViewResolvers(ModelAndViewResolver[] customModelAndViewResolvers) {
          this.customModelAndViewResolvers = customModelAndViewResolvers;
      }
  
      public void setMessageConverters(HttpMessageConverter[] messageConverters) {
          this.messageConverters = messageConverters;
      }
  
      public void setReplaceMessageConverters(boolean replaceMessageConverters) {
          this.replaceMessageConverters = replaceMessageConverters;
      }
  }
  </code></pre>
  
  <p>but now with Spring 3.1 <code>AnnotationMethodHandlerAdapter</code> has been replaced by <code>RequestMappingHandlerAdapter</code>, how can change my class <code>AnnotationMethodHandlerAdapterConfigurer</code> for Spring 3.1? Thanks!</p>