title: URLRewrite in Tomcat 7
body: <p>I am planning to develop an Intranet application (Java client, JSP, SQLite)</p>
  
  <p>Goal of this is that when a user clicks on the link, if the user has access (to a team which is handled in the business logic)  a file should be provided for download</p>
  
  <p>There is a table in the db which holds the info and below is the example row</p>
  
  <pre class="lang-none prettyprint-override"><code>ID | file                               | team   | md5
  1  | D:\test\output_20140915_100012.zip | Falcon | 5cceaf4cc400fd8f5c7fb4b2af754f4093369f59
  </code></pre>
  
  <p>where MD5 is the MD% checksum of the string "D:\test\output.zip" and not the file itself</p>
  
  <p>I create the MD5 just for the sake of having random number. Reason I don't use RAND is to avoid collision (this part is trivial)</p>
  
  <p>I want my URL to look like this  </p>
  
  <pre class="lang-none prettyprint-override"><code>http://mywebserver:8080/&lt;appname&gt;/5cceaf4cc400fd8f5c7fb4b2af754f4093369f59
  </code></pre>
  
  <p>Which should be taken to</p>
  
  <pre class="lang-none prettyprint-override"><code>http://mywebserver:8080/&lt;appname&gt;/download.jsp?id=5cceaf4cc400fd8f5c7fb4b2af754f4093369f59
  </code></pre>
  
  <p>I am using Tomcat and I am wondering if how we could have a URL rewrite for this scenario</p>