search
LoginSignup
5

More than 5 years have passed since last update.

posted at

playframeworkのroutingでListを受ける

playframeworkのrouteで受けれるのは以下の型

Play 2.x supports the following query string parameter types:
String
Char
Int
Integer (Java)
Long (Scala and Java)
Double (Scala and Java)
Float (Scala and Java)
Boolean (Scala and Java)
java.util.UUID
Option
Optional (Java)
Seq
List (Scala and Java)
Array
See Binders.scala for all supported types.

http://stackoverflow.com/questions/31684919/how-to-route-map-like-parameters-in-get-request-with-play

routes定義

routes
GET    /hoge/list    @controllers.HogeController.list(query: List[String])

Controller定義

HogeController.scala
def list(query: List[String])

クエリ

/hoge/fuga?query=AAAA&query=BBBB

参考

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
5