Question

I am getting a json response from java to jsp in the below format:

[
   {
      "title":"JAVA",
      "time":"2hrs"
   },
   {
      "title":"JSP"
   },
   {
      "title":"JSTL"
   },
   {
      "title":"JQUERY"
   }
]

This i have to iterate it and show in the JSP. I dont want to display it through javascript / jquery because my requirement demands me to display json object using jsp, jstl. Please suggest me some solution?

Was it helpful?

Solution

You should parse the JSON input in your controller, with Jackson for example, and add the data to simple objects. These you should pass to your model, which is available in your view. In you view simply iterate the created objects.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top