I have a hashmap as variable in baking bean like.
private Map<String, Map> states;
But it will be a string. Please help
You should always separate as much as possible the server-side from client-side, else you’ll end up having a hard to mantain, not understandable and error prone code. That being said, you can convert your map to JSON and send that json to the client-side, so it can be handled as you want:
var statesJSON = JSON.parse( );
Now you can write your client-side code (regarding the population of the drop-down lists) by using the
global variable. You can follow these links for how to populate a drop-down list based on selection on another :