struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton Pussep <>
Subject Re: sort entries by the selected tag
Date Mon, 11 Jun 2007 11:27:19 GMT
I think you're right, the View should not be responsible for sorting.
But now I would like to sort by values and I could not find any Map that
is capable of doing so. Do you have any suggestion? Or probably you had
to solve this problem already, then I would love to hear how you did it.

It does not necessarily have to be a sorting map, it could be also one
that just guarantees that its elements keep the order in that they have
been added.


Al Sutton wrote:
> I've always put sorting as part of the action by determining the sort order
> creating an appropriate Comparator implementation and using it in the
> constructor for the TreeMap.
> I've done this because imho your view should just be about presentation, and
> the logic for determining and implementing your sort should be in your
> action.
> -----Original Message-----
> From: Anton Pussep [] 
> Sent: 10 June 2007 21:46
> To: Struts Users Mailing List
> Subject: sort entries by the selected tag
> Hello,
> I would like to sort the menu created by the selected tag. So far I just
> pass a TreeMap where the entries are sorted already. However, I think that
> the View should decide whether to sort or not to sort, but I could not find
> a way to force the selected tag to sort. Is there anything you can
> recommend?
> <s:form action="DeleteUser">
>     <s:select
>         list="idToNameMapping"
>         name="userId"
>         emptyOption="false" />
>     <s:submit />
> </s:form>
> Thanks and best regards,
> Anton
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message