title: automatic trailing slash redirection with Spring MVC
body: <p>I'd like to configure Spring MVC to do the following for me:</p>
  
  <pre><code>If (a controller is not found
  &amp;&amp; controller exist for requestURI with or without trailing slash) {
      redirect 301 to other URI with or without trailing slash
  } else {
      return 404 error
  }
  </code></pre>
  
  <p>The above should be done by spring, not by some web.xml filter since only spring can test whether a redirect makes sense, i.e. whether there is a controller to handle the redirected request.</p>