Since El expressions do not support cyclically output values in map, jstl must be used to traverse map cyclically.
This is the action corresponding to map.
Public actionforward execute (actionmapping mapping, actionform form,
Httpservletrequest request, httpservletresponse response)
Throws exception {
Map map = new hashmap ();
Map. Put ("K1", "Feng jianghong, you are ridiculous ");
Map. Put ("K2", "you can't think of today ");
Map. Put ("K3", "This is a bitter taste, have you tasted it ");
Request. setattribute ("maps", MAP );
Return Mapping. findforward ("success ");
}
The page can be retrieved like this
<Li> use the jstl loop to get all values in Map </LI> <br>
<C: foreach items = "$ {maps}" Var = "map">
Map key: $ {map. Key} <br>
MAP value: $ {map. Value} <br>
</C: foreach>
What are the elements in the map set? It is a map. Entry object, which includes the getkey () and getvalue () methods.
Therefore, you can use the El expression map on the page and click the navigation key to retrieve the key value in the map.