Use the SortTool

http://velocity.apache.org/tools/devel/generic/ look for SortTool.

----- Original Message ----- 
From: "cha" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, September 21, 2007 10:20 AM
Subject: how to Sort the List


>
> Hi All,
>
> Am trying to sort the list of First Alphabets of merchants but cant able
to
> do that. It seems that Collections.sort($List)) is not working.
>
> Below is my sample code:
>
> #foreach ($merchant in $merchants)
> #if (!$List.contains($merchant.getName().substring(0,1).toUpperCase()))
>   #set ($boolean =
> $List.add($merchant.getName().substring(0,1).toUpperCase()))
> #end
> #end
> Collections.sort($List))
>
> Please do let me know, how to accomplish sorting in Velocity.
>
> Cheers,
> Cha
> -- 
> View this message in context:
http://www.nabble.com/how-to-Sort-the-List-tf4492216.html#a12811877
> Sent from the Velocity - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to