Primitive data types in routes file?

20 views
Skip to first unread message

Koen De Groote

unread,
Jul 19, 2017, 12:04:45 PM7/19/17
to Play Framework
Am I supposed to use Object Types in route parameters or is there a way to use primitive data types?


But no information on where this is defined or what rules I have to follow for other data types. Or if this is even correct.

Is there a document with this info I can consult?

Matthias Kurz

unread,
Jul 20, 2017, 3:29:33 AM7/20/17
to Play Framework
The routes file is parsed and compiled via Scala, not Java. In Scala there are no primitive types like in Java. Instead you have to use Int, Long, etc. which can be found in the scala package. So no, you can't use Java primitive types in the routes files.
If you explicitly want to use Java types instead you could write value:java.lang.Integer however.

Hope that helps.

Best regards,
Matthias
Reply all
Reply to author
Forward
0 new messages