title: Java HTTP request transformers
body: <p>I'm considering adapting a legacy API to a newer API by transforming incoming HTTP requests. I'm using Spring and Jersey. Right now, the way I am transforming incoming HTTP requests is by introducing a Servlet filter which wraps the incoming <code>HttpServletRequest</code> in an adapter object which transforms request components (headers, post body, query, etc.) to the newer request model.</p>
  
  <p>My question is if there are other tools to do this kind of thing. I know of Mule ESB and Spring Integration, which have transformers / converters to do this kind of thing. I feel these are a little heavyweight for my purpose, however.</p>
  
  <p>Here's an example of an old request, and the new request I want it mapped to.</p>
  
  <p>Old:</p>
  
  <pre><code>GET /resource?id=abc&amp;auth=xyz&amp;params=&lt;encoded-params&gt;
  </code></pre>
  
  <p>New:</p>
  
  <pre><code>GET /resource/id?&lt;unencoded-params&gt;
  Authorization: xyz
  </code></pre>
  
  <p>Thanks!</p>