title: Spring RequestParam formatter for Scala.Option
body: <p>We are using Spring MVC in our Scala application and I would like to figure out how to unwrap Scala <code>Option</code>'s so they can be properly converted using <code>@RequestParam</code>. I think the solution may have something to do with the <a href="http://docs.spring.io/spring/docs/current/spring-framework-reference/html/validation.html#format-Formatter-SPI" rel="nofollow">Formatter SPI</a>, but I am unsure how to get this to work nicely given that <code>Option</code>'s can contain any number of values (which I'd want Spring to handle normally, as if the converted value were not an <code>Option</code> at all). In essence, I'd almost want to apply an additional conversion of a value to be <code>Option</code> wrapped after normal conversion takes place.</p>
  
  <p>For example, given the following code:</p>
  
  <pre><code>@RequestMapping(method = Array(GET), value = Array("/test"))
  def test(@RequestParam("foo") foo: Option[String]): String
  </code></pre>
  
  <p>The url <code>/test</code> should result in the <code>foo</code> parameter getting a value of <code>None</code>, while the url <code>/test?foo=bar</code> should result in the <code>foo</code> parameter getting a value of <code>Some("bar")</code> (<code>/test?foo</code> could result in either an empty String, or <code>None</code>).</p>