I have some data to be sent from ModelandView class which has a map. I map the data and send it to my jsp page. But not able to retrieve the data using jstl tag. The controller is sending the data to the specified jsp but its not displayed in the specified field due to jstl tag usage. It would be great if someone finds the error.
Controller.java
public ModelandView getData(@Context HttpServletRequest request) {
Map<String,String> map=new HashMap<String,String>();
ModelandView responseView = new ModelandView("trackData",map);
//some code here
if (somecondition) {
map.put("data",detailsVO.getVehicleId());
responseView.addAllObjects(map);
}
else {
System.out.println("Not present");
}
return responseView;
}
trackData.jsp
<select class="testdata" id="listvehicle">
<c:forEach var="sample" items="${data}">
<option> ${sample}</option>
</c:forEach>
</select>
The jsp page is not displaying any values in the drop-down list.