【问题标题】:What is the ?= operator in the Play Framework?Play 框架中的 ?= 运算符是什么?
【发布时间】:2019-06-12 05:18:12
【问题描述】:

我看到在 Play 中定义路由时,?= 运算符用于设置默认值。但是我在文档中找不到任何对它的引用。该操作员在哪里记录?这是 Scala 的东西还是 Play Framework 的东西?

示例用法:

GET  /users  controllers.Application.users(max:java.lang.Integer ?= 50, page:java.lang.Integer ?= 0)

(取自:How to handle optional query parameters in Play framework)。

【问题讨论】:

    标签: scala playframework


    【解决方案1】:

    这是特定于 Play 框架的。它(简要地)记录在routing section中。

    conf/routes是路由器使用的配置文件。

    routes 文件不是 Scala;它只是像它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-11
      • 2013-07-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-19
      • 2021-12-04
      • 2021-10-28
      相关资源
      最近更新 更多