From docs for serializeJson:
> Note: ColdFusion internally represents structure key names using
> all-uppercase characters, and, therefore, serializes the key names to
> all-uppercase JSON representations. Any JavaScript that handles JSON
> representations of ColdFusion structures must use all-uppercase
> structure key names, such as CITY or STATE. You also use the
> all-uppercase names COLUMNS and DATA as the keys for the two arrays
> that represent ColdFusion queries in JSON format.
To make CFML case-insensitive so that it is "easier" to write code -
without having to worry about getting everything "right". When
ACF/Railo see foo.bar they turn it into foo["BAR"] and the basic
"struct" in CFML is a variant of the standard Java HashMap that
uppercases keys before looking them up.
Yet another legacy of trying to remove the barrier to entry in a
language, I'm afraid, and being unable to break backward
compatibility.
> Is it possible to make Railo improvement?
Whilst I'm sure an Administrator option could be added that made
structs case sensitive, I bet money that such an option would break
pretty much all CFML written more than a few years ago :(
Now that I'm using Clojure extensively with CFML, I'm running into
this all the time. I've had to introduce a compatibility layer that
maps Clojure map keys to uppercase strings so that foo.bar works in
CFML (and vice versa). Fortunately Clojure's idiom is all
lower-case-with-hyphens so I can easily map between Clojure and CFML:
{ foo = 42, bar = "Hi!" } - which is really { "FOO" = 42, "BAR" =
"Hi!" } - becomes {:foo 42 :bar "Hi!"} in Clojure and vice versa.
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
Railo Technologies, Inc. -- http://www.getrailo.com/
"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)
We never have implement this because we think this brings more confusion than it helps
/micha
Vo mim iPhone gschickt