Scala 在哪里定义了内部错误页

Scala 在哪里定义了内部错误页,scala,playframework,Scala,Playframework,在哪里可以找到方法的实现,如Ok,BadRequest,InternalServerError,NotFound 我查看了播放文档,但找不到。具体地说,我查看了Results.class,但是那里的实现似乎与预期的不同。例如,我们在代码中使用的Ok方法采用如下参数: Ok(views.html.index("Welcome")(userForm)) 但是Results.class中Ok的实现是 val Ok : Results.this.Status = { /* compiled code

在哪里可以找到方法的实现,如
Ok
BadRequest
InternalServerError
NotFound

我查看了播放文档,但找不到。具体地说,我查看了
Results.class
,但是那里的实现似乎与预期的不同。例如,我们在代码中使用的
Ok
方法采用如下参数:

Ok(views.html.index("Welcome")(userForm))
但是
Results.class
Ok
的实现是

val Ok : Results.this.Status = { /* compiled code */ }
在Scala中(在Play 2.5.x的例子中,这个想法在其他版本中也类似):

Ok
BadRequest
的来源非常相似):

因此,
Ok
是对象,
Ok(“某些字符串”)
是函数表示法中的对象。在对象表示法中,它是
Ok.apply(“一些字符串”)

状态的来源
代码:

应用
状态的代码为

/**
 * Set the result's content.
 *
 * @param content The content to send.
 */
def apply[C](content: C)(implicit writeable: Writeable[C]): Result = {
  Result(
    header,
    writeable.toEntity(content)
  )
}
然后您可以转到
可写
类:

对于不同的类型,有许多
可写内容
,例如
字符串
就是这样

implicit def wString(implicit codec: Codec): Writeable[String] = Writeable[String](str => codec.encode(str))
编解码器
实现您可以在这里找到:

在Scala中(在Play 2.5.x的示例中,这个想法在其他版本中也类似):

Ok
BadRequest
的来源非常相似):

因此,
Ok
是对象,
Ok(“某些字符串”)
是函数表示法中的对象。在对象表示法中,它是
Ok.apply(“一些字符串”)

状态的来源
代码:

应用
状态
的代码为

/**
 * Set the result's content.
 *
 * @param content The content to send.
 */
def apply[C](content: C)(implicit writeable: Writeable[C]): Result = {
  Result(
    header,
    writeable.toEntity(content)
  )
}
然后您可以转到
可写
类:

对于不同的类型,有许多
可写内容
,例如
字符串
就是这样

implicit def wString(implicit codec: Codec): Writeable[String] = Writeable[String](str => codec.encode(str))
编解码器
实现您可以在这里找到: