title: Which classes of method argument may be annotated with @RequestHeader
body: <p>I want to access the time-stamp in a <code>If-Modified-Since</code> header, so I can implement conditional GET.</p>
  
  <p>Spring controllers can use the <a href="http://static.springsource.org/spring/docs/3.2.x/javadoc-api/org/springframework/web/bind/annotation/RequestHeader.html" rel="nofollow"><code>@RequestHeader</code></a> annotation to indicate that Spring should pass the value of an HTTP header to a handler method as a method argument. Must the argument be a <code>String</code>? Or are other classes permitted? The <a href="http://static.springsource.org/spring/docs/3.0.0.M3/reference/html/ch16s11.html" rel="nofollow">Spring documentation</a> implies that <code>long</code> values can be converted. But what is the set of classes permitted?</p>
  
  <p>Will the following work (using a <code>Date</code>)?</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.GET, headers = {"If-Modified-Since" })
  public final void conditionallyRetrieve(
     @RequestHeader("If-Modified-Since")final Date ifModifiedSince,
     final HttpServletResponse response) {
     ...
  }
  </code></pre>