I want to convert hashmap into json object, my hashmap structure is look like this:
def res=Action{ implicit request=>
var response=new HashMap[String,Map[String,String]]
response=//etc .......
.
.
.
Ok(write(response))
}
bt its not working .
Try this:
Ok(Json.toJson(response.toMap))
This would convert your HashMap
to a Map
which can be written as json without additional code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With