struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Søren Blidorf <so...@nolas.dk>
Subject Sort a collection in alphabetic order
Date Mon, 10 Mar 2003 18:16:58 GMT

Hi.
I need to sort my collection "people" in alphabetic order by lastname,
firstname.
Can anybody help me?

I guess I should do it in the Action and not when displayed in jsp page.



Collection people = new ArrayList();

while( rs.next() ) {
PeopleBean pb = new PeopleBean();
pb.setId(rs.getInt("ID"));
pb.setFirstname( rs.getString( "FIRSTNAME" ));
pb.setLastname( rs.getString( "LASTNAME" ));
}

people.add( pb );


Søren Blidorf





---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message