I need help to sort this list to be alphabetically
I have an array list in this list name have different categories and color. I need to sort it by cotegories, color and sort by ascending order
the out come will be like this Ami is name, cat is categories and color is blue..(color that I mention is color font)
Ami-cat-blue
Aki-cat-blue
Bobo-cat-blue
Bobby-dog-yellow
riki-dog-yellow
Code:
for( int i=0; i < records.size(); i++) {
if (((String) (((Attributes) records.elementAt(i)).get("animaltype").get())).equals("cat")) {
catList.add(records.elementAt(i));
} else if (((String) (((Attributes) records.elementAt(i)).get("animaltype").get())).equals("dogs")) {
dogsList.add(records.elementAt(i));
}
records.removeAllElements();
records.addAll(catList);
records.addAll(dogsList);
now I can sort it by color and categories but how to make name list in ascending order in jsp
Need HELP...thank you