I am trying to call a HashMap value in jsp page but got error there and error says
There was an unexpected error (type=Internal Server Error, status=500). For input string: "res"
My code;
<c:forEach items="${onlineExamList}" var="item"
                                        varStatus="loop">
                                        <div>
                                            <b>${item.question1}</b><br>
                                            <div class="radio">
                                                <label><input type="radio" value="a"
                                                    name="answers[${loop.index}]">${item.option1}</label>
                                            </div>
                                            <div class="radio">
                                                <label><input type="radio" value="b"
                                                    name="answers[${loop.index}]">${item.option2}</label>
                                            </div>
                                            <div class="radio">
                                                <label><input type="radio" value="c"
                                                    name="answers[${loop.index}]">${item.option3}</label>
                                            </div>
                                            <div class="radio">
                                                <label><input type="radio" value="d"
                                                    name="answers[${loop.index}]">${item.option4}</label>
                                            </div>
                                            <input type="text" name="rightAnswer"
                                                value="${item.rightAnswer}">
//problem in this line
                                            <c:if test="${result != null}">
                                                <br>
                                                <br>
                                                <b>Your answer: ${result.get("res"+loop.index).get(1)}</b>
                                                <br>
                                            </c:if>
                                        </div>
                                        <hr />
                                    </c:forEach>
And this is how i have set hashmap from controller
Map<String, List<String>> mapResult = new HashMap<String, List<String>>();
        int totalScore = 0;
        for (int i = 0; i < answers.answers.size(); i++) {
            List<String> result = new ArrayList<>();
            String res = "Wrong";
            if (answers.answers.get(i).equals(answers.rightAnswer.get(i))) {
                res = "Correct";
                totalScore+=10;
            }
            result.add(res);
            result.add(answers.answers.get(i));
            result.add(answers.rightAnswer.get(i));
            mapResult.put("res" + i, result);
        }
        ra.addFlashAttribute("result", mapResult);
        ra.addFlashAttribute("score", totalScore);
Same things printed on java page
for (int i = 0; i < 10; i++) {
            System.out.println(mapResult.get("res" + i).get(0));
            System.out.println(mapResult.get("res" + i).get(1));
            System.out.println(mapResult.get("res" + i).get(2));
            System.out.println("...................................");;
        }
How can I print hashmap value in jsp page?
 
     
     
    