Sungwhan Han Sungwhan Han - 1 year ago 74
Scala Question

scale-play response jsondata to view List

enter image description here

I got json data using ws.
And then we will
I want to display it in a list format in view.
I do not know how to do it.
please help me!

enter image description here

Answer Source

I may have misunderstood your question, but sounds like you want a browser page to view the data? You will need to define a view to display it in, and then invoke this view with the Ok method. For example, in your controller, replacing Ok(Json.toJson(json)) with Ok(views.html.messages(Messages)) and creating the file messages.scala.html in the views package, which looks something like:

@(messages:List[Message]) {
  <table class="table table-striped"> { message =>

Anything beginning with @ is a scala expression. Use a template functions to decorate or standardise your pages, see Playframework Template Use Cases

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download