I have list of string which i have add in a Custom map
The CustomMap class is a kind of custom map which I am using as utility class to refer the key and value
Example
List<CustomMap<Integer,String>> dropdown=new Arraylist<CustomMap<Integer,String>>;
map.put(1,"APPLE");
map.put(2,"BANANA");
map.put(2,"ORANGE");
map.put(2,"apple");
session.setAttribute("dropdown", dropdown);
In my jsp
<select name="fruit" id="fruit" class="selectBox">
<c:forEach var="dropdown" items="${dropdown}">
<c:choose>
<option value="${dropdown.key}" selected>${dropdown.value}</option>
I am able to list down all the values in dropdown which look like below
APPLE
BANNANA
ORANGE
apple
Now I want to add a sub category which should look like below
APPLE
---apple
BANNANA
ORANGE
How could I achieve the subcategory? After selecting the value I am sending the key value back to controller for further proceessing.