1

I'm having this json:

{
"maxAgentAmt": 66,
"minComAmt": 3,
"maxTxn": 7,
"maxAmt": 99,
"minAmt": 3,
"maxComAmt": 99
}

and I also have to get values from json array having multiple json objects:

 [{
    "comType": "V",
    "comValue": 5757,
    "comMode": "E",
    "maxAmt": 7575,
    "minAmt": 3,
    "comGSTMode": "E"
}, {
    "comType": "E",
    "comValue": "E",
    "comMode": "V",
    "maxAmt": 8,
    "minAmt": 4,
    "comGSTMode": 8
}]

This is for Json Object:

<c:if test="${not empty list}">
      <c:forEach items="${list.getJSONObject(\"maxAgentAmt\")}" 
              var="list" varStatus="rowCounterCh">
              <li>${maxAgentAmt}</li>
      </c:forEach>
 </c:if>

And, I don't know how to iterrate jsonarray having multiple json objects

1 Answer 1

0

Finally I got some solution :

<%

String shareRule = (String) session.getAttribute("shareRule");

JSONObject shareRuleJson = new JSONObject(shareRule);

String tdsFlag = shareRuleJson.get("tdsFlag").toString();

%>

value="<%=tdsFlag%>"

Same, if user want to iterate json array then he will do the same for json array case also.

This will solve my problem. I hope it will solve somebody also

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.