scala 将Map转换成Json字符串:
import scala.util.parsing.json.JSONObject
JSONObject.apply(wordsMap).toString()
JSON字符串转Map:
import collection.immutale.Map
import scala.util.parsing.json.JSON
def str2map(jsonstr:String): Map[String,Any] ={
val vsome = JSON.parseFull(jsonstr)
val vmap = vsome match{
case Some(map:Map[String,Any]) => map
}
vmap
}