scala - 如何在 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..
如何为选项类型执行此操作?
解决方案
推荐阅读
- reactjs - 仅替换 URL 中的最后一个路径部分
- amadeus - Amadeus api 返回 401 客户端凭据无效
- javascript - 如何使用 Javascript 删除动态字段
- xml - 如何在Oracle中解决复杂的XMLELEMENT
- c# - wcf 如何为 SOAP Web 服务设置不可为空的 DataMember
- python - 没有这样的文件或目录:'/dev/ttyUSB0'
- sql - Grafana - 放大时没有数据
- jquery - 将模型值传递给 Jquery 函数
- ios - Firebase:阻止它进入 Firebase 身份验证服务,当在特定视图上按下后退按钮时
- javascript - 使用 CSS 转换使用箭头键输入来翻译/旋转精灵。更新位置问题