当前位置: 动力学知识库 > 问答 > 编程问答 >

java - How to define a play route to pass an int[] param to the action

问题描述:

I am new to Java, Playframework and Scala. I am trying to create a route to my action using an array, but am getting an error. I know the error says to use a custom query binder, but I also found spots that refer to this being supported in play 2.1. I am using 2.2.1. Is there something that I am missing, or do I need to create a custom QueryStringBinder? Is there a better way to do this?

Route -

GET /someAction controllers.MyController.someAction(employees:Array[Int])

Controller Action -

public static Result someAction(Array<int> employees)

{

...

}

Error :

No QueryString binder found for type Array[Int]. Try to implement an implicit QueryStringBindable for this type.

分享给朋友:
您可能感兴趣的文章:
随机阅读: