title: Can i use Spring's @RequestMapping and BeanNameUrlHandlerMapping in conjuntion with each other to map a URL to method?
body: <p>What I would like to do is have a common Service class which has various methods such as "search" "retriveByID" etc. 
  Ideally this class would consume the service parameters and populate a request object and hand off to the appropriate data source handler. </p>
  
  <p>I want to instantiated a service class as a Spring bean with different request handlers depending on the domain object being searched. Then using bean BeanNameUrlHandlerMapping invoke a different Service class based on the URL. </p>
  
  <pre><code>&lt;bean name="/sequence/*" class="org.dfci.cccb.services.SearchServiceImpl"&gt;
      &lt;property name="searchHandler"&gt;
       ....
  </code></pre>
  
  <p>My problem is that when i try to do this I can't use method level RequestMapping annotations to select the appropriate method of the service class. </p>
  
  <pre><code>@RequestMapping("*/search/")
  QueryResult search(...
  </code></pre>
  
  <p>Alternatively is it possible to inject annotation values through bean definitions?</p>
  
  <p><strong>UPDATE</strong>
  There is also a Springsource article on this topic: 
  <a href="http://blog.springsource.com/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/" rel="nofollow noreferrer">http://blog.springsource.com/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/</a></p>