Take data array from an API via Java

Asked

Viewed 112 times

0

I have an API with a data array. Example:

"bandeiras" : [
     {
            "bandeira": "MASTER",
            "status": "ATIVO"
          },
          {
            "bandeira": "HIPER",
            "status": "ATIVO"
          } ]

What I have to do to get the data from each flag, and that’s when I click the button fly flags , for in the last jsp of the project it displays all these flags with the values.

I created the DTO with the API return values. However, I don’t know how I’m going to handle this in the controller when I click the jsp button, since it only has to display at the end of the stream.

Any hint/solution?

1 answer

0


Have you already set this your array in an object of type Flags? If you have already set, just pass the array to the front.

<c:forEach items="${bandeiras}" var="bandeira">
<tr>      
    <td>${bandeira.bandeira}</td>
    <td>${bandeira.status}</td>
</tr>
</c:forEach>

Otherwise, update there what has already been done, hug

Browser other questions tagged

You are not signed in. Login or sign up in order to post.