Instead of this:
<cfset mystruct = StructNew() />
Do this:
<cfset mystruct = createObject("java", "java.util.LinkedHashMap").init() />
A java LinkedHashMap object can be treated exactly the same as a structure created by StructNew(). You can assign values the same way, and you can even loop over it the same way using <cfloop collection="...">. Need to do a StructSort? You can do that, too. The only difference is that cfloop will loop over it in the order in which the elements were assigned.
3 comments:
great!!!
Very, very cool!
very useful.. i could have save lot of time if i found this one before..
Thanks a lot
anusha
Post a Comment