A quick inspection of the java docs for java.util.Hashtable turned up the putAll() method. With it, you can 'put' one struct into another, overwriting any matching keys.
So, to very quickly and elegantly combine the form and url scopes into a request variable called 'args', we can do:
<cfset request.args = StructNew()>Et voila!
<cfset request.args.putAll(url)>
<cfset request.args.putAll(form)>
4 comments:
Nice one. I was halfway through a collection loop when I found this post!
Adrian
:)
You seem very keen to avoid built in coldfusion functions :-) How about
StructAppend(struct1, struct2, overwriteFlag)
eg:
structAppend(FORM, URL);
lol brilliant - not keen at all, just didn't realise you could do that. Love it!
Post a Comment