title: Hard-coded @RequestMapping URL in Spring MVC Controller
body: <p>I'm studying Spring 3 and I'm using it in a simple web-application.</p>
  
  <p>Now I'm implementing a Spring MVC Controller using annotations, and I'm wondering:
  Is there any best practice using <code>@RequestMapping</code> annotation?</p>
  
  <p>I mean: I've seen that usually the URL mapped in this annotation is hardcoded in the class...<br/>
  <strong>Is there a way to pass the URL in a 'loosely coupled way' (to obtain a more reusable class)?</strong></p>
  
  <p>I know that there are some <em>wild cards</em> that can be used, but I think that isn't the solution... Am I wrong?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I add an example to better explain my doubt.</p>
  
  <p>Suppose I want my controller to be triggered by a request to <code>/foo/bar/baz/mypage.htm</code>, in my controller the handler method will be annotated with <code>@RequestMapping("/foo/bar/baz/mypage")</code>.</p>
  
  <p>Now I decide to change the URL triggering my controller into <code>/foo/bar/otherpage.htm</code>, so i need to edit my class, put <code>@RequestMapping("/foo/bar/otherpage")</code> on my handler method, recompile the project and deploy it again.</p>
  
  <p>It seems to me not so practical...</p>