title: How to handle optional query parameters in Play framework
body: <p>Lets say I have an already functioning Play 2.0 framework based application in Scala that serves a URL such as:</p>
  
  <p><a href="http://localhost:9000/birthdays">http://localhost:9000/birthdays</a></p>
  
  <p>which responds with a listing of all known birthdays</p>
  
  <p>I now want to enhance this by adding the ability to restrict results with optional "from" (date) and "to" request params such as</p>
  
  <p><a href="http://localhost:9000/birthdays?from=20120131&amp;to=20120229">http://localhost:9000/birthdays?from=20120131&amp;to=20120229</a></p>
  
  <p>(dates here interpreted as yyyyMMdd)</p>
  
  <p>My question is how to handle the request param binding and interpretation in Play 2.0 with Scala, especially given that both of these params should be optional. </p>
  
  <p>Should these parameters be somehow expressed in the "routes" specification? Alternatively, should the responding Controller method pick apart the params from the request object somehow? Is there another way to do this?</p>