In fact, after a few games around, what I came up with and it seems to work
String sortColumn = (String)getRequestParam("sort_id"); List<Quote> quotes = (List<Quote>)getSessionScope().get(SESS_SEARCH_RESULTS); Comparator fieldCompare = new org.apache.commons.beanutils.BeanComparator( sortColumn ); Collections.sort(quotes, fieldCompare );
You just need to look at the sort order now.
source share