0

I am calling a Java method from a JSP page like below:

<%

HashMap<String, String> cancelList=new HashMap<String, String>();
cancelList=ProductGetCancellationList.getCancellationList((String)session.getAttribute("PRODUCTID"));
%>

I am getting the key and value pair fine.

Now i want to use the key,value pair from "cancelList" hashmap to populate a dropdown list in the same JSP page. Here's what i am currently trying to do but not getting intended result.

 <c:forEach var="cancel" items="${cancelList}">
        <option value=${cancel.key}>${cancel.value}</option>
    </c:forEach>

Kindly help me here...

Dhritidhar
  • 13
  • 5
  • Please clarify _not getting intended result_. – Sotirios Delimanolis Jan 01 '16 at 18:28
  • Hi, Thanks for your suggested post, but there the code used servlet objects to pass the hashmap ref., but in my case i dont have the liberty to use httpservlet's request response. Is there any way without using the servlet object. By intended result i see that in the dropdown list i am getting the value as "${cancel.value}" – Dhritidhar Jan 01 '16 at 19:49

0 Answers0