Jared Rypka-Hauer wrote his first from-scratch application in Commodore Basic at the age of 9. In his teens, he dabbled in everything from dBase to HyperCard and was instrumental in the development of several commercial software products. In 1990, he began his professional IT career, spending the first 8 years primarily in end-user support and Infrastructure. Since 1998, his interests have revolved around ColdFusion and dynamic web applications. Finally making the jump to using OO methods for web development in January of 2005, he's become a presence in the web-development blogging community and has written for outlets such as FusionAuthority and ColdFusion Developer's Journal. Jared is also the primary organizer of the CF.Objective conference.
This tidbit just in: if you've had an issue where you have things in mappings (like ColdSpring, for example) and you're having issues with those mappings resolving correctly while hitting CFCs via the built-in Flash Remoting gateway that comes with ColdFusion, try this:
Open {cf install dir}/web-inf/flex/remoting-config.xml and change <use-mappings>false</use-mappings> to <use-mappings>true</use-mappings> (line 24 in my remoting-config.xml file).
Restart your ColdFusion instance.
Test your Flex app with your CFCs in a mapped location instead of in the webroot.
It works? Great!
Why? Well, lets assume you're trying to find a file via expandPath("/coldspring")... as near as I can tell, with that setting set to true, the remoting gateway will simply slap /coldspring onto the end of the webroot path and look in that directory, say "c:\inetpub\wwwroot\coldspring" when /coldspring is mapped to "c:\webdev\external\coldspring". The remoting gateway never checks to see if there is a mapping called coldspring, it just assumes that / means "webroot-relative". With that setting on, however, the remoting gateway checks with CF to see if there's a /coldspring mapping before it does anything with the webroot path.
There's some question as to why it is an issue with instantiating a CFC vs once the CFC has been instantiated... apparently once you've instantiated the CFC it works fine. I'm assuming that it's because the gateway servlet is involved at first, and then the CFC servlet. The CFC servlet works fine and once it's in control of the CFC it resolves paths correctly.
Just a guess, but it's the only reason I see that things would behave the way they do.
Best of luck with this...
J
LOL!
Thanks for pointing that out, Matt... it's now fixed.
J
I think you left out a key part. ;-) Relatively self-evident, but you want to change <use-mappings> from false to true (as opposed to changing it from true to false) I believe.
Posted By: Matt Woodward on Dec 5, 2007 at 12:00 AM