title: How to do wildcard bean mapping in Spring MVC?
body: <p>I'm trying to do RESTful URL mapping in Spring 2.5. This essentially means:
  /fetch/(something)
  should all be matched to controller fetch</p>
  
  <p>And the controller will do something according the parameter (something)</p>
  
  <p>I add this to my spring config:</p>
  
  <pre><code>&lt;bean id="fetchController" class="(package).fetchController" scope="singleton"/&gt;
  
  &lt;bean id="fetchService" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"&gt;
      &lt;property name="mappings"&gt;
          &lt;props&gt;
              &lt;prop key="/fetch/*"&gt;fetchController&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>and add the following to my <code>web.xml</code></p>
  
  <pre><code>&lt;servlet-mapping&gt;
      &lt;servlet-name&gt;springGlobal&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/fetch/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;springGlobal&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  </code></pre>
  
  <p>But this doesn't seem to be correct. The log says:
  org.springframework.web.servlet.PageNotFound  - No mapping found for HTTP request with URI [/fetch/charts] in DispatcherServlet with name 'springGlobal'</p>