title: How to ignore a particular URI pattern in spring RequestMapping?
body: <p>My spring controller should take any get request of any URI type except a URI which started with <code>/resources/*</code> as this is the call, if I am not wrong, done by spring container to load all the static content in view page.</p>
  
  <p>Current configuration is like this</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.GET, value="/*")
  </code></pre>
  
  <p>which working fine for request with URI <code>/</code> or <code>/example</code> but if someone make a typo in URI eg. <code>/example/random/char</code> it is throwing exception trace page not found(404) which is pretty obvious and leads me to make <code>value="/**"</code></p>
  
  <pre><code>@RequestMapping(method = RequestMethod.GET, value="/**")
  </code></pre>
  
  <p>then the request with URI <code>/</code> or <code>/example</code> are unable to load my static content <code>.js, .css or .png</code> files in my view page. This lead me to the conclusion that spring internally make get call to load these files with an URL pattern eg. <code>http://localhost:8080/resources/my.jpg</code>.</p>
  
  <p><strong>Note:-</strong> I intentionally removed my project name by configuring tomcat.</p>
  
  <p><strong>Update</strong>
  Okay @dimitrisli comment make me realize that I need to elaborate a little about my project.</p>
  
  <p>It basically a URL redirecting component. A user simply call my application through get request and ended with redirecting to the actual page. </p>
  
  <p>For example user request me throw their browser with URL let's say <code>http://localhost:8080/sample</code>. Now my application needs to split the URL to get the string <code>sample</code> and search in db for the actual URL against it(so <code>sample</code> is the alias name for a really long URL). If URL exist it will redirect to the actual page else page does not exist message will show.</p>