Julien Richard-Foy
unread,May 21, 2012, 12:09:42 PM5/21/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to play-fr...@googlegroups.com
QueryStringBindable binds values from the request query string.
PathBindable binds values from the request path.
In the routes file you can tell the framework how to dispatch the
incoming requests based on their path. So, when the parameters binders
will be invoked they *know* there will be a value for each path
parameter of the route (otherwise the route wouldn’t have matched). On
the other hand, the query string may not contain some parameters.
So here are the contracts of PathBindable#bind and QueryStringBindable#bind:
T PathBindable#bind(String key, String rawValue)
-> returns a T built from the rawValue string (or throws an exception
if such a value was not possible to build).
Option<T> QueryStringBindable(String key, Map<String, String[]> queryString)
-> returns None if there was no parameter `key` in the `queryString`.
Otherwise returns a value of type Some<T>, containing the value built
from the query string data (or throws an exception if the value was
not possible to build).