Eric,

I don't think ColdFusion mappings are involved when accessing files 
other than ColdFusion templates and components (.cfm and .cfc).  If you 
look at the source of your web page in your browser, you'll probably see 
that the URLs are still "/cup/images/image.png".  The web server then 
prepends the server name when handling the request.

You'll need to create a "cup" virtual directory for that host, and point 
it to where the mapping is pointing.  If the only purpose of the mapping 
is for URLs to static resources, you don't even need the mapping at all.

As a side note, is the application scope even available to make 
assignments before the onApplicationStart() function is called? Your 
application.cuproot variable may not even exist when the constructor is 
processing the <cfset this.mappings... stuff (especially on first run of 
the application).

HTH,
-Carl V.

On 11/26/2013 10:36 AM, Eric Roberts wrote:
> I am trying to set up some local mappings (CF9) and it doiesn't seem to
> recognize it.  I have this as part of several variables that are set before
> the 1st function in my application.cfc...
>
> <cfset this.mappings[ "/cup" ] = "#application.cuproot#/cup">
>
>
>
> For instance...when I try to access an image in a directory (the path from
> the root is /cup/images/image.png), I call <img src="/cup/images/image.png"
> />, instead of mapping it like i would expect it to, it just appends the
> server url and i get something like
> http://www.xxx.com/cup/images/image.pngwhen it should be
> http://www.xxx.com/er/cup/images/image.png.  I have dumped
> application.cuproot and it has the appropriate value.  It just seems to be
> ignoring the fact that i am setting up a CF mapping,  If I do the mapping
> in cf admin...it works as expected.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357146
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to