title: Spring programmatically register RequestMapping
body: <p>I have a working url as this: <code>localhost/info</code> </p>
  
  <pre><code>@Controller
  @RequestMapping("/info")
  public class VersionController {
  
     @RequestMapping(value = "", method = RequestMethod.GET)
     public @ResponseBody
     Map get() {
        loadProperties();
        Map&lt;String, String&gt; m = new HashMap&lt;String, String&gt;();
        m.put("buildTimestamp", properties.getProperty("Application-Build-Timestamp"));
        m.put("version", properties.getProperty("Application-Version"));
        return m;
     }
  
  }
  </code></pre>
  
  <p>and I would to register some other mappings at initializing of my application as this:</p>
  
  <pre><code>localhost/xxxx/info
  localhost/yyyy/info
  localhost/zzzz/info
  </code></pre>
  
  <p>All these urls will return same response as <code>localhost/info</code></p>
  
  <p>The xxxx, yyyy part of the application is changeable. I have to register custom mappings as </p>
  
  <pre><code>@Override
  public void addViewControllers(ViewControllerRegistry registry) {
      registry.addViewController("???").setViewName("???");
  }
  </code></pre>
  
  <p>Bu this is only working for views. </p>
  
  <p>Any idea for dynamic registration?</p>