参考官网:https://www.playframework.com/documentation/2.0.1/ScalaJson
json的操作类似scala.xml._ api的特性
val json: JsValue = Json.parse(jsonString) val json = Json.parse(jsonString)val maybeName = (json \ "user" \ name).asOpt[String]val emails = (json \ "user" \\ "emails").map(_.as[String])
本文出自 “脚踏实地,仰望星空” 博客,请务必保留此出处http://xubcing.blog.51cto.com/3502962/1671223
原文地址:http://xubcing.blog.51cto.com/3502962/1671223