I want to display the key value bean based on sorting of value in Struts 2.
You can try and sort the values in Action class itself, so when select is rendered the list will appear sorted
The List
is an ordered collection. If it contains elements sorted by the key property then other the value property remains unsorted unless it's the same property. To make it sorted on another property you can sort the list with the comparator.
Collections.sort(myList, myComparator);
or you can use s:sort
tag like in this example. And you only have to provide the comparator in the action class.