title: Evaluate a default parameter at runtime
body: <p>I have a following route which is not what I am looking for:</p>
  
  <pre><code>GET   /                     controllers.Application.index(someParam = "???")
  GET   /:someParam           controllers.Application.index(someParam)
  </code></pre>
  
  <p><strong>The value of <code>someParam</code> is unknown at compile time thus it should be evaluated at runtime.</strong> </p>
  
  <p>In fact, what I'd like to do is that, <code>index</code> must always redirects to <code>index/someParam</code>. So if an user goes to <code>/</code> (root path), they get redirected to <code>/someParam</code> (<code>someParam</code> is evaluated at runtime). If they go to <code>/someWrongParam</code>, they also get redirected to <code>/someRightParam</code>, meaning <code>someParam</code> can be within some finite set of values. I hope that's not too complicated.</p>
  
  <p>I saw this solution <a href="https://stackoverflow.com/a/14984873/2813589">https://stackoverflow.com/a/14984873/2813589</a> but it seemed too complex.</p>
  
  <p>How can I do this?</p>