SimpleHash loses the insertion order

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SimpleHash loses the insertion order

Indra
Hi,

  I am using the SimpleHash in controller to display the elemnts on view. I lose the insertion order of elements. Is there any way to retain it or can u suggest some different data structure that could be helpful in my case (Pls dont suggest 2 list :( ).

Thanks in advacne for your help.
Reply | Threaded
Open this post in threaded view
|

Re: SimpleHash loses the insertion order

Daniel Dekany
Friday, July 23, 2010, 8:09:51 PM, Indra wrote:

> Hi,
>
>   I am using the SimpleHash in controller to display the elemnts on view. I
> lose the insertion order of elements. Is there any way to retain it or can u
> suggest some different data structure that could be helpful in my case (Pls
> dont suggest 2 list :( ).
>
> Thanks in advacne for your help.

Use java.util.LinkedHashMap. FreeMarker's object wrapper should
automatically wrap it in a way so that the order is kept. (In general,
you seldom (if ever) need to deal with concrete wrapper classes, like
SimpleHashMap.)

--
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel