首页 > 解决方案 > 如何在 playframework 中使用 Option 类型作为路径婴儿车?

问题描述

我想在路由文件中使用选项类型作为路径参数来调用控制器中的操作方法-

在路由文件中

GET /test/:x/:y       controllers.TestController.test(x:Int, y:Option[Int])

在控制器中 -

def test(x:Int,y:Option[Int])=Action{. . . .}

但我的编译器说我 -

 implement an implicit PathBindable for this type..

如何为选项类型执行此操作?

标签: scalaplayframework

解决方案


推荐阅读