title: Single @RequestMapping for multiple controllers
body: <p>I'm trying to create a single <code>@RequestMapping</code> value for 2 or 3 controllers unfortunately I'm getting error</p>
  
  <p>Eg:</p>
  
  <pre><code>@Controller
  public class contatcs {
  
    @RequestMapping(value="Save", params="m=contacts")
    public ModelAndView SaveContacts(@ModelAttribute("command") ContactsBean contactsBean,
          BindingResult result)
      //some stuff
      return new ModelAndView("/savecontacts");
    }
  
    @RequestMapping(value="update", params="m=contacts")
    public ModelAndView UpdateContacts(@ModelAttribute("command") ContactsBean contactsBean,
          BindingResult result)
      //some stuff
      return new ModelAndView("/updatecontacts");
    }
  }
  
  
  
  @Controller
  public class clients {
  
    @RequestMapping(value="Save", params="m=clients")
    public ModelAndView SaveClients(@ModelAttribute("command") ContactsBean contactsBean,
          BindingResult result)
      //some stuff
      return new ModelAndView("/saveclients");
    }
  
    @RequestMapping(value="update", params="m=clients")
    public ModelAndView updateClients(@ModelAttribute("command") ContactsBean contactsBean,
          BindingResult result)
      //some stuff
      return new ModelAndView("/updateclients");
    }
  }
  </code></pre>
  
  <p>in above I use <code>Save</code> in 2 controller so I'm getting error If I use with single controller it works as I expected</p>
  
  <p>Error is: </p>
  
  <pre><code>SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Cannot map handler [clients] to URL path [//save]: There is already handler [crm.venkat.controller.Clients@7e47dc12] mapped.
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:562)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
      at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: java.lang.IllegalStateException: Cannot map handler [clientCompaniesController] to URL path [//Search]: There is already handler [crm.venkat.controller.ClientCompaniesController@7e47dc12] mapped.
      at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:376)
      at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:348)
      at org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.detectHandlers(AbstractDetectingUrlHandlerMapping.java:82)
      at org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.initApplicationContext(AbstractDetectingUrlHandlerMapping.java:58)
      at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
      at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:71)
      at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
      at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:99)
      at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:82)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1396)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
      ... 20 more
  </code></pre>