【发布时间】:2021-10-23 09:59:51
【问题描述】:
在 Play Framework 中,我在控制器中有以下方法:
def country(countryCode: String) =
Authorized().async { implicit request =>
val country = Country.find(countryCode).get
val countryPostcodeZones = postcodeZones.get(country)
val placeholder = countryPostcodeZones.postcodeType.placeholder
}
如何将其作为 Json 字符串返回以在我的本地主机上查看它,以响应 Ajax 请求?
【问题讨论】:
-
这是一个 Play 应用程序吗?
-
您阅读过 Play 框架文档吗?有一个专门的部分介绍如何使用 Play JSON 库编写 JSON...
-
请看here
标签: json scala playframework