playframework/Play20 — pull request #269 by julienrf (2012-04-28 19:39:58+00:00)
Title: Helper to retrieve the first value of a query string parameter

## Summary

### Scala API

* Add `QueryString.getString(params: Map[String, Seq[String]]): Option[String]`, a helper method retrieving the first value of a given query string parameter. Example:

``` scala
import play.api.mvc.QueryString.getString
def index = Action { request =>
val foo: Option[String] = getString(request.queryString, "foo")
Ok
}
```

* Add an implicit conversion pimping a `Map[String, Seq[String]]` value, adding it a `getString(key: String): Option[String]` method, allowing to use a more object idiomatic style. Example:

``` scala
import play.api.mvc.QueryString.implicits._
def index = Action { request =>
val foo: Option[String] = request.queryString.getString("foo")
Ok
}
```

### Java API

* Define a `QueryString` class, subclassing `HashMap` so it is fully backward source compatible.
* Define a `public String getString(String key)` method to the `QueryString` class. Example:

``` java
public static Result index() {
String foo = request().queryString().getString("foo");
return ok();
}
```